C# .NET - Find gridview in devexpress gridcontrol using name of the gridview

Asked By Somanathan E on 22-Jun-12 08:14 AM
Earn up to 30 extra points for answering this tough question.
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
Glad to help!
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.
help
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 28-Oct-12 07:58 PM 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
this.SuspendLayout(); / / / / SqlWizardEx / / resources.ApplyResources(this, "$this"); this.Name = "SqlWizardEx"; this.ResumeLayout(false); } #endregion private DevExpress.XtraEditors.SplitContainerControl splitTopSelect; private DevExpress.XtraEditors.SplitContainerControl splitWizResult; private DevExpress.XtraEditors.MemoEdit txtSelect; private SqlBuilder sqlBuilder; private DevExpress.XtraEditors.MemoEdit txtError; private DevExpress.XtraGrid.GridControl gridResults; private DevExpress.XtraGrid.Views.Grid.GridView gridView; private DevExpress.XtraEditors.PanelControl panelButtons; private DevExpress.XtraEditors.SimpleButton btnCancel; private DevExpress.XtraEditors.SimpleButton btnOK; } } * ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** And this
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
ich suche eine Alternative dazu. Hoffe ihr kennt da noch was. Gr??e Manuel btw: DevExpress kann es nicht. C# - German Discussions DevExpress.XtraGrid.Views.Base.BaseView (1) DevExpress.XtraGrid.Views.Grid.GridView (1) DevExpress.XtraEditors.Repository.RepositoryItem (1) DevExpress.XtraGrid.Columns.GridColumn (1) System.ComponentModel.ISupportInitialize (1 DevExpress.XtraGrid.GridControl (1) System.ComponentModel.IContainer (1) System.Drawing.SizeF (1) Btw. http: / / user.cs.tu-berlin contents of this method with the code editor. / / / < / summary> private void InitializeComponent() { this.gridControl1 = new DevExpress.XtraGrid.GridControl(); this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridColumn2 = new DevExpress.XtraGrid