C# .NET - Find gridview in devexpress gridcontrol using name of the gridview
Asked By Somanathan E on 22-Jun-12 08:14 AM
How to find a specific view by providing the name of the gridview to gridcontrol ?.
Is there any way to get the gridview object by only knowing its name .
[)ia6l0 iii replied to Somanathan E on 22-Jun-12 12:31 PM
Good Q.
The GridControl has a property called as ViewCollection, that returns the views in the grid. Note that this would only contain the views that are used. These include the "Mainview" and the "clone" view.
You would need to loop thru the collection and figure out the grid inside this view collection. Please see below for a sample.
for (int counter = 0; counter < gridControl.ViewCollection.Count; counter++)
{
if (gridControl.ViewCollection[counter].GetType() == typeof(GridView))
{
GridView gv = (GridView)gridControl.ViewCollection[counter] as GridView;
//Use its name property and determine the gridview
}
}
Hope this helps.
Somanathan E replied to [)ia6l0 iii on 22-Jun-12 01:03 PM
Thanks for your very useful reply.
[)ia6l0 iii replied to Somanathan E on 22-Jun-12 01:10 PM
Jitendra Faye replied to Somanathan E on 25-Jun-12 01:24 AM
For this you can simply iterate ViewCollection in GridControl.
Try to find like tis-
foreach (ViewCollection view in gridControl.ViewCollection)
{
if (view.GetType() == typeof(GridView))
{
GridView grdview= (GridView) view as GridView;
}
}
TRy this and let me know.
am using a devexpress gridcontrol. after loading a data into the gridcontrol. when i click on page index to check the next page data in a devexpressgridcontol keywords: GridViewPageEventArgsGridView1.PageIndex, GridView, ASP.NET, PageIndexChanging, FillGridBySearch description: problem in paging am using a devexpress gridcontrol. after loading a data into the gridcontrol. when i click on page index to check the next page data in
Good Evening experts, I need you help. . I have one GridControl of Devexpress on my form. now i want to make cells of particular rows disable based on disable. how to do that ? I am already iterating through the loop on rows of gridcontrol. but i don't know how to make particular row disable ? please help me here below sample it helps u Protected Sub SolutionGridView_HtmlCommandCellPrepared( ByVal sender As Object , ByVal e As DevExpress.Web.ASPxGridView.ASPxGridViewTableCommandCellEventArgs) Handles SolutionGridView.HtmlCommandCellPrepared 2 shoppingCart = Session( "ShoppingCart" ) 3 4 If shoppingCart.ContainsItem Then 5 If e.CommandCellType = DevExpress.Web.ASPxGridView.GridViewTableCommandCellType.Data Then 6 Dim _item As Item = shoppingCart.GetItemById(e.KeyValue) 7 have alreay mentioned it's windows application form not web page. . Also i am using devexpress xtra grid GridControl not the gridview provided by microsoft in studio. keywords: GridViewRowEventArgsWebControl, GridView, VB
I use DevExpress.XtraGrid.GridControl to create a grid, and I will set up it with datas from a text dataTable; and when I bild and debug the solution, all the datas are in my gridcontrol (They are in gridControlJournal.DataSource.Rows.ItemArray) but I can't see them in my Because I've never used it. Look in your documentation for some example code. keywords: GridControl, DevExpress, datas description: I can not see my datas in a DevExpress XtraGrid G I use DevExpress.XtraGrid.GridControl to create a grid, and I will set up it with datas from
Hello I Am Deloping One Project and For that i m Using Devexpress Cotroll , But I Dont knw how to make devexpress gridcontroll transperant so i can see the background image <Window.Resources> <ControlTemplate x:Key = "GridTemplate TargetType = "{x:Type dxg:GridControl}" > <ContentControl x:Name = "PART_ThemesLoader" Background = "Transparent" > <Border BorderBrush = "{TemplateBinding BorderBrush}" BorderThickness = "{TemplateBinding BorderThickness}" Background = "{TemplateBinding Background}" > <ContentPresenter Content = "{TemplateBinding View}" / > < / Border> < / ContentControl> < / ControlTemplate> < / Window.Resources> <dxg:GridControl x:Name = "dxGrid" Grid.Row = "3" Grid.ColumnSpan = "2" Template = "{StaticResource GridTemplate}" Background = "Transparent" > . . . < / dxg GridControl> hi, o achieve this goal you should define your own custom template for GridControl. use this code to set the transparent Protected Sub Page_Load(sender As Object , e As ASPxGridView1.Styles.Table.BackColor = Color.Transparent End Sub for more help check this http: / / www.devexpress.com / Support / Center / p / Q139598.aspx http: / / www.devexpress.com / Support / Center / p / Q292441.aspx
string color C# .NET 06-Jun-13 10:16 AM hai am jeya am using devexpress advance banded gridcontrol and i pass one string value in to that grid in this case i want could check here for all the features of the grid you are using. . http: / / www.devexpress.com / Products / NET / Controls / WinForms / Grid / grid_view.xml In your Item Template - lable contol you server" Text = '<%# DataBinder.Eval(Container, "DataItem.EmployeeName")%> '> < / asp:label> < / Font> < / ItemTemplate> < / asp:datalist> keywords: Grid, devexpress description: change the string color hai am jeya am using devexpress advance banded gridcontrol and i pass one string value in to that grid in this case i want
hey guys- I have one form which has single column GridView of DevExpress. I don't want to allow user to change their selection in Edit mode. So for your quick response. . it's not a simple GridView of dot net . . it's DevExpress Gridview. . In the devexpress control. . . I have GridControl. So it's has one associated default GridView . . . it's doesn't have any item template or edititem template. . . check this discussion if it helps you: http: / / www.devexpress.com / Support / Center / p / Q318005.aspx and also this : http: / / www.devexpress.com / Support / Center / KB / p / A281.aspx Thanks again but i am working on windows application and the namespace for gridview is DevExpress.xTraGrid.View.GridView and it's doesn;t have CellEditingChanged event which is mentioned in
dxg: GridControl. . is not recognized while loading XML in DevExpress Silverlight / WPF 06-Jun-13 10:02 AM Hi, In a .Net windows WPF application ColumnDefinitions> <ColumnDefinition Width = ""100*"" / > <ColumnDefinition Width = ""200*"" / > < / Grid.ColumnDefinitions> <StackPanel Name = ""StackLabels"" Margin = ""3""> <dxg:GridControl x:Name = ""gridControl1""AutoPopulateColumns = ""True"" Height = ""228"" width = ""607""> < / dxg:GridControl> <Label Height = ""28"" Name = ""ProductIDLabel"" HorizontalContentAlignment = ""Right""> ProductID:< / Label> <Label Height = ""28"" Name = ""PackNoLabel"" HorizontalContentAlignment new StringReader (xaml); XDocument xdoc = XDocument .Load(sr); / / Error occurs here not recognized the <dxg: GridControl. . this .Content = XamlReader .Load(xdoc.CreateReader()); gridControl1.DataSource = this .Content; Its not working since the below code is not recognized while loading XDocument.Load(xaml) <dxg:GridControl x:Name = ""gridControl1""AutoPopulateColumns = ""True"" Height = ""228"" width = ""607""> < / dxg GridControl> Since this is DevExpress Grid Control. . .Please advice me. Thanks Chandru By seeing your code , Try like this- public
06-Jun-13 10:02 AM Hi, I am working in WPF windows application with Devexpress XtraGrid string xaml = @"<Grid Name = ""Grid1"" xmlns = ""http: / / schemas.microsoft.com / winfx / 2006 / xaml / presentation xmlns:x = ""http: / / schemas.microsoft.com / winfx / 2006 / xaml""> <StackPanel Name = ""StackLabels"" Margin = ""3""> <dxg:GridControl x:Name = ""gridControl1""AutoPopulateColumns = ""True"" Height = ""228"" width = ""607""> < / dxg:GridControl> <Label Height = ""28"" Name = ""ProductIDLabel""HorizontalContentAlignment = ""Right""> ProductID:< / Label> <Label Height = ""28"" Name = ""PackNoLabel"" HorizontalContentAlignment error in the below line StreamReader sreader = new StreamReader(xaml); I think the tag <dxg:GridControl is not recognized because i am using DevExpress Grid Plz advice me Thanks Chandru Hello Friend. To resolve it, modify the bindings in xmlns:x = ""http: / / schemas.microsoft.com / winfx / 2006 / xaml""> <StackPanel Name = ""StackLabels"" Margin = ""3""> <dxg:GridControl x:Name = ""gridControl1""AutoPopulateColumns = ""True"" Height = ""228"" width = ""607""> < / dxg:GridControl> <Label Height = ""28"" Name = ""ProductIDLabel""HorizontalContentAlignment = ""Right""> ProductID:< / Label> <Label Height = ""28"" Name = ""PackNoLabel"" HorizontalContentAlignment 28"" Name = ""VersionToLabel"" HorizontalContentAlignment = ""Right""> VersionTo:< / Label> < / StackPanel> < / Grid> " ; if i omit the line <dxg:GridControl x:Name = ""gridControl1""AutoPopulateColumns = ""True"" Height = ""228"" width = ""607""> < / dxg:GridControl> the code works. . . . If
10:01 AM Hi Experts - I need one help from you guys. . I am using Devexpress controls. I have one form having one "TabbedControlGroup". In side this tab control , i have 3-4 tabs and inside each tab i have one dev express GridControl. Now What i want is , i want to export all grid data in single excel file. For a single grid we can use " GridControl.ExportToXls( ) " method which will directly export grid data to excel. . But i have 3-4 single excel file Hi Experts - I need one help from you guys. . I am using Devexpress controls. I have one form having one Ta