We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

gridDataBoundGrid - using as a databound list box

Thread ID:

Created:

Updated:

Platform:

Replies:

40006 Jan 23,2006 01:21 PM Jan 25,2006 04:00 AM Windows Forms 8
loading
Tags: GridControl
Badri Rajani Kanth
Asked On January 23, 2006 01:21 PM

Hi, I want to create a control from gridDataBoundGrid, which will give me similer functionality like a list box(same properties and events). This is because, when no of datarows are more(50K), I observed grid to be faster than listbox. Do we have any such control in place? Or just tell me how to remove all columns headers from gridDataBoundGrid. I will keep asking if i get any more doubts in this custom control creation process..thank you in advance. Rgds Rajani Kanth

Administrator [Syncfusion]
Replied On January 24, 2006 06:24 AM

Hi Badri, You can use a GridListControl like a list box. Refer the sample in Syncfusion\Essential Studio\3.3.0.0\windows\Grid.Windows\Samples\Quick Start\GridListControlSample\ to know about GridListControl. By setting this.gridListControl1.ShowColumnHeader = false; and the this.gridListControl1.MultiColumn = false; you can make it similar like a list box. To hide the headers in the GridDataBoundGrid, set this.gridDataBoundGrid1.Model.Cols.Hidden[0] = true; this.gridDataBoundGrid1.Model.Rows.Hidden[0] = true; Best Regards, Calvin.

Badri Rajani Kanth
Replied On January 24, 2006 09:15 AM

Cool, I am actually working with that. The one main problem i have with that control is NOT having SelectedItems collection. As my user can select any no of items, i need to have a SelectedItems collection which can me Count and All selected objects. Any input plz? Rgds Badri >Hi Badri, > >You can use a GridListControl like a list box. Refer the sample in Syncfusion\Essential Studio\3.3.0.0\windows\Grid.Windows\Samples\Quick Start\GridListControlSample\ to know about GridListControl. By setting this.gridListControl1.ShowColumnHeader = false; and the this.gridListControl1.MultiColumn = false; you can make it similar like a list box. > >To hide the headers in the GridDataBoundGrid, set >this.gridDataBoundGrid1.Model.Cols.Hidden[0] = true; >this.gridDataBoundGrid1.Model.Rows.Hidden[0] = true; > >Best Regards, >Calvin.

Badri Rajani Kanth
Replied On January 24, 2006 09:22 AM

Hi, In addition, we dont have SelectedIndices also. I am using Grid.Selections.Count for SelectedItems.Count. But, when selected items are many, i have problems.. Rgds Rajani Kanth >Cool, > >I am actually working with that. >The one main problem i have with that control is NOT having SelectedItems collection. As my user can select any no of items, i need to have a SelectedItems collection which can me Count and All selected objects. Any input plz? > >Rgds >Badri > >>Hi Badri, >> >>You can use a GridListControl like a list box. Refer the sample in Syncfusion\Essential Studio\3.3.0.0\windows\Grid.Windows\Samples\Quick Start\GridListControlSample\ to know about GridListControl. By setting this.gridListControl1.ShowColumnHeader = false; and the this.gridListControl1.MultiColumn = false; you can make it similar like a list box. >> >>To hide the headers in the GridDataBoundGrid, set >>this.gridDataBoundGrid1.Model.Cols.Hidden[0] = true; >>this.gridDataBoundGrid1.Model.Rows.Hidden[0] = true; >> >>Best Regards, >>Calvin.

stanleyj [Syncfusion]
Replied On January 24, 2006 10:25 AM

Hi Badri, Check out this article, this may help. Best regards, Stanley

Badri Rajani Kanth
Replied On January 24, 2006 11:13 AM

Hi, This article is about dataBoundGrid. And also, I am looking to retrieve objects from SelectedItems Count of GridListControl. Plz inform me if any related samples/articles exists.. Rgds Badri >Hi Badri, > >Check out this article, this may help. > >Best regards, >Stanley

Badri Rajani Kanth
Replied On January 24, 2006 11:40 AM

Hi, Ideally I want to store and retrieve daraRows/dataRowViews and retrieve the same from GridListControl. If i just go by text property, i can have many duplicates. Rgds Rajani Kanth >Hi, >This article is about dataBoundGrid. And also, >I am looking to retrieve objects from SelectedItems Count of GridListControl. Plz inform me if any related samples/articles exists.. >Rgds >Badri > >>Hi Badri, >> >>Check out this article, this may help. >> >>Best regards, >>Stanley

Badri Rajani Kanth
Replied On January 24, 2006 12:01 PM

Hi, I am trying with below code. Is this OK? foreach(Syncfusion.Windows.Forms.Grid.GridRangeInfo range in list) { for(int i = range.Top; i <= range.Bottom; i++) { DataRowView dataRowView = this.gridListControl1.Items[i-1] as DataRowView; string firstName = dataRowView.Row["FirstName"].ToString(); //DisplayMember string lastName = dataRowView.Row["LastName"].ToString(); //ValueMember System.Diagnostics.Debug.WriteLine(firstName + ":" + lastName); } } .. Plz confirm.. Rgds Rajani Kanth >Hi, >Ideally I want to store and retrieve daraRows/dataRowViews and retrieve the same from GridListControl. If i just go by text property, i can have many duplicates. > >Rgds >Rajani Kanth > > > > >>Hi, >>This article is about dataBoundGrid. And also, >>I am looking to retrieve objects from SelectedItems Count of GridListControl. Plz inform me if any related samples/articles exists.. >>Rgds >>Badri >> >>>Hi Badri, >>> >>>Check out this article, this may help. >>> >>>Best regards, >>>Stanley

Administrator [Syncfusion]
Replied On January 25, 2006 04:00 AM

Hi Badri, Yes, you can retrieve the selected rows as mentioned and you can also add a row to the grid by just adding it to the Table. Below is the code snippet. DataTable dt = (DataTable)this.gridListControl1.DataSource; DataRow dr = dt.NewRow(); dr[0]="John"; dr[1]="Knox"; dt.Rows.Add(dr); Regards, Calvin.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;