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.

GridListControl - GridRangeInfo Selected Range Not Refreshed

Thread ID:

Created:

Updated:

Platform:

Replies:

44068 May 12,2006 05:16 AM May 17,2006 05:59 AM Windows Forms 4
loading
Tags: GridControl
Badri Rajani Kanth
Asked On May 12, 2006 05:16 AM

Hi, We are using v3.2.1.0. I am using a GridListControl, bound to a dataview. When we select an item(s) in list box, I am getting selected items using GridRangeInfoList selectedList; selectedList = lstbxSelected.Grid.Selections.GetSelectedRows(true, false); foreach(GridRangeInfo range in selectedList) { for(int rowNo = range.Top-1; rowNo < range.Bottom; rowNo++) etc and deleting the row from dataview. As the GridListControl is databound, item is delted from GridListControl also. But again when I select some other item and call same method, range.Top and range.Bottom are not reflectd. Suppose if I was getting 5 earlier, now also I am getting same value 5. Even if the 5 item got already deleted. I think selected ranges are not refreshing properly. Can you please tell me what to do? Shall I have to call any other method also? Rgds Rajani Kanth Badri

Administrator [Syncfusion]
Replied On May 12, 2006 05:54 AM

Hi Badri, Please refer to the forum thread for more details. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=43222 Thanks for your interest in Syncfusion Products. Best Regards, Haneef

Badri Rajani Kanth
Replied On May 17, 2006 03:58 AM

Hi, I have checked the link, but I am not able to see the refesh happening in the sample application. When I add, i dont see items added and same is the case with delete. We are using selection range and continuous data binding. And we may not assign and reassign the datasource. Can we not refresh the grid by other means? Rgds Rajani Kanth

Badri Rajani Kanth
Replied On May 17, 2006 04:42 AM

Hi, Without re-assigning the datasource, I am using the below code to delete rows and refresh grid list control. Can you plz inform me if any thing wrong with the used methods? GridRangeInfoList selectedList = gridListControl.Grid.Selections.GetSelectedRows(true, false); foreach(GridRangeInfo range in selectedList) { for(int rowNo = range.Top-1; rowNo < range.Bottom; rowNo++) { rowNo = (rowNo==-1)?0:rowNo; DataRowView dataRowView = gridListControl.Items[rowNo] as DataRowView; if(dataRowView != null) { CRMDirectory.ShortUBSPersonRow currentRow =dataRowView.Row as CRMDirectory.ShortUBSPersonRow; deletedRowsList.Add(currentRow); } }//end of for-loop } //end of foreach-loop //clear and refresh grid gridListControl.Grid.Selections.Clear(); gridListControl.Grid.Refresh(); gridListControl.Refresh(); foreach(CRMDirectory.ShortUBSPersonRow deletedItem in deletedRowsList) { mSelected.ShortUBSPerson.RemoveShortUBSPersonRow(deletedItem) ; } Rgds Rajani Kanth

Administrator [Syncfusion]
Replied On May 17, 2006 05:59 AM

Hi Rajani kanth, You need to call the ResetVolatileData method for refresh the GridListContol after modifying the underlying datasource.ResetVolatileData() Resets the volatile data cache.Call this method if you wan to refresh the grid and force grid cells that are visible at the moment to reload all their data form data source.Also, thre row and column count will be required. Please try this code GridRangeInfoList selectedList = gridListControl.Grid.Selections.GetSelectedRows(true, false); foreach(GridRangeInfo range in selectedList) { for(int rowNo = range.Top-1; rowNo < range.Bottom; rowNo++) { rowNo = (rowNo==-1)?0:rowNo; DataRowView dataRowView = gridListControl.Items[rowNo] as DataRowView; if(dataRowView != null) { CRMDirectory.ShortUBSPersonRow currentRow =dataRowView.Row as CRMDirectory.ShortUBSPersonRow; deletedRowsList.Add(currentRow); } }//end of for-loop } //end of foreach-loop foreach(CRMDirectory.ShortUBSPersonRow deletedItem in deletedRowsList) { mSelected.ShortUBSPerson.RemoveShortUBSPersonRow(deletedItem) ; } //clear and refresh grid gridListControl.Grid.Selections.Clear(); gridListControl.Grid.ResetVolatileData(); gridListControl.Refresh(); Here is a sample. http://www.syncfusion.com/Support/user/uploads/GridListTest_c29ab25.zip Regards, Haneef

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.

;