The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team May 12, 2006 09:54 AM UTC
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
BRBadri Rajani KanthMay 17, 2006 07:58 AM UTC
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
BRBadri Rajani KanthMay 17, 2006 08:42 AM UTC
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
ADAdministrator Syncfusion Team May 17, 2006 09:59 AM UTC
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