This is a migrated thread and some comments may be shown as answers.

RadGrid is not refreshed

11 Answers 964 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 27 Aug 2007, 07:09 AM
Hi,

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

Sort by
0
Jack
Telerik team
answered on 27 Aug 2007, 02:20 PM
Hi eriksurya,

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
0
Erik
Top achievements
Rank 1
answered on 28 Aug 2007, 02:57 AM
Hi Telerik,
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

0
Jack
Telerik team
answered on 28 Aug 2007, 08:15 AM
Hi eriksurya,

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
0
Erik
Top achievements
Rank 1
answered on 28 Aug 2007, 08:59 AM
Please have alook on this link. It's similiar case but differen scenario. This is my guess..
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
0
Julian Benkov
Telerik team
answered on 29 Aug 2007, 03:54 PM
Hello eriksurya, we are found problems with external updates of RadGridView. The problem is fixed and fix will be available in our upcoming Q2 release coming soon. Then you would only need to delete the row from bound DataSet or DataTable and RadGridView will automatically be refreshed.

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
0
Christopher
Top achievements
Rank 1
answered on 05 Dec 2008, 07:39 PM
It's Dec 2008 and even running the latest version of the Telerik Controls....I get the same problem. What bothers me is this isn't a catchable error in the primary form and causes a "Index 0 is either negative or above rows count." exception all the way up to the Programs.cs class in my Windows Form.
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.

0
Julian Benkov
Telerik team
answered on 08 Dec 2008, 05:00 PM
Hello Christopher,

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.
0
BB Agrawal
Top achievements
Rank 1
answered on 14 Jan 2010, 07:04 AM
Hi There,
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
0
Basel Nimer
Top achievements
Rank 2
answered on 17 Apr 2010, 12:18 PM
how quick is this?

0
Julian Benkov
Telerik team
answered on 21 Apr 2010, 02:13 PM
Hi Basel Nimer,

You can use the SortChanged event for this scenario:

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.
0
Kapil
Top achievements
Rank 1
Iron
answered on 29 May 2021, 11:34 PM | edited on 29 May 2021, 11:35 PM

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?

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 31 May 2021, 04:26 AM

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. 

 
Tags
GridView
Asked by
Erik
Top achievements
Rank 1
Answers by
Jack
Telerik team
Erik
Top achievements
Rank 1
Julian Benkov
Telerik team
Christopher
Top achievements
Rank 1
BB Agrawal
Top achievements
Rank 1
Basel Nimer
Top achievements
Rank 2
Kapil
Top achievements
Rank 1
Iron
Share this question
or