I use this telerik for quite sometime now. My question is about the radgrid. We use radgrid quite intensively.
Im trying to delete data using dataadapter and call refresh function of the grid.
dataset.tables(0).row(0).delete
dataadapter.update(dataset)
grid.refresh
The grid didnt refresh and the data is still there. I checked the database, it deleted.
I thought my coding is working then i tried using microsoft grid and I can the desired result. Please help. Is this bug?
Another case: when i try to update and grid is updated.
What happen?
11 Answers, 1 is accepted
This issue is fixed in our current version and will be publicly available in the next release (Q2 2007) in September. You can update grid data bindings by using this code:
Me.RadGridView1.MasterGridViewInfo.UpdateView()
Regards,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
thanks for the answer. But I got error exception
System.indexoutOfRangeException: Index 2 is either negative or above rows count.
at system.data.dataview.getelement(Int32 index)
at system.data.dataview.system.collections.Ilist.get_item(int32 recordIndex)
at telerik.wincontrols.UI.gridviewdata.getvalue(int32 boundcolumnIndex,int32 columnIndex, Int32 rowIndex)
Please help
We apologize for this inconvenience. I am not quite sure what exactly causes this exception. Can you give us more details on what situation the issue occurs? Will be possible for you to open a support ticket and send us your application in order to investigate the situation? Thanks in advance.
Sincerely yours,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
In my case:
When i try to delete the item using dataset and update dataadapter , this case will happen. Only when the we got more than 2 data.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=12394&SiteID=1
Thanks
dataset.tables(0).row(0).delete
dataadapter.update(dataset)
Sorry again for the inconvenience.
Kind regards,
Julian Benkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Here is my remove logic:
private BindingList<IM.Core.Entities.PackageEntity> _Packages;
public BindingList<IM.Core.Entities.PackageEntity> Packages
{
get { return _Packages; }
set { _Packages = value; }
}
private void rgvPackage_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
{
switch (e.Action)
{
case Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove:
GridViewDataRowInfo gridRow = (GridViewDataRowInfo)rgvPackage.CurrentRow;
// Get databound object
PackageEntity item = (PackageEntity)gridRow.DataBoundItem;
// Remove from Collection
Packages.Remove(item);
RefreshPackageGrid();
break;
}
}
private void RefreshPackageGrid()
{
try
{
rgvPackage.MasterGridViewTemplate.DataSource = null;
rgvPackage.Refresh();
if (Packages.Count > 0)
{
BindingSource bsPackages = new BindingSource();
bsPackages.DataSource = Packages;
ConfigureGridViewComboColumn("CourierColumn", "Name", "CourierRefID").DataSource = Session.IMDbClient.GetAllCouriers();
ConfigureGridViewComboColumn("ShippingMethodColumn", "Description", "ShippingMethodRefID").DataSource = Session.IMDbClient.GetAllShippingMethods();
ConfigureGridViewComboColumn("PackageTypeColumn", "Name", "PackageTypeRefID").DataSource = Session.IMDbClient.GetAllPackageTypes();
rgvPackage.DataSource = bsPackages;
rgvPackage.Refresh();
}
}
catch (System.Exception ex)
{
}
}
This only happens when my BindingList is empty.
Please send us a simple project with your scenario to reproduce it locally. You can do so in a new support ticket.
Thank you in advance.
Greetings,
Julian Benkov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I am using RadGrid control of telerik since a long time. I have an issue with sorting. I have created 5-6 usercontrols and put that on the same page. The last user control is having a RadGrid. When I click on any any header of the grid data gets sorted but that takes me to the starting of the page i.e. on the top of the page. So every time the user tries to sort data he has to scroll again to see the sorted data. Do we have any feature in telerik thru which we can avoid this?
A quick reply is expected.
Thanks!
BB Agrawal
void
radGridView1_SortChanged(
object
sender, GridViewCollectionChangedEventArgs e)
{
this
.radGridView1.GridElement.ScrollToRow(radGridView1.CurrentRow);
}
Regards,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Hii I m Having the Same Refresh Issue I m using a BindingList and adding that list to radgridView using radgridview.dataSource=list even I refreshed the Bindinglist programmatically and did radgridview1.refresh() but still the GridView is not refreshed to new data still showing the old one!
am I doing something wrong?
RadGridView is capable of fetching bindable properties and data. However, one important issue must be noted: during the data binding process, the grid extracts the data from the data source, but for any later changes in the data source, RadGridView should be notified. Your bindable collection and business objects should follow some standards established in .NET in order to notify RadGridView about the changes. I would recommend you to have a look at the following help article which is quite useful on this topic: https://docs.telerik.com/devtools/winforms/controls/gridview/populating-with-data/reflecting-custom-object-changes-in-rgv
I hope this information helps. If you need any further assistance please don't hesitate to contact me.