Hi All,
First of all let me tell you i am having an MDI Application. where i am using Ultrawin toolbar. Using that i have created two buttons for two forms of my application. In one form i am having Infragistics Wingrid in which i am listing the list of all the employees. This form is for the display purpose and if any one wants to see details abt that emp they can double click perticular emp and its detail form get open.
Second form is the form from where i can add new employee.In my application its such that we have to provide button to open new form using ultra win toolbar.
Now when user runs the application by default the child form will be the form which display the list in wingrid. If the user wants to add new emplyoee he will click and open form.
Problem is when the save button get hit the data get saved in the database successully and that form gets close and focus come back on listing form but the grid is not getting refreshed and the new entry is not getting listed in the grid. To get that row in the grid i have to close it and open it again then only it come.
Can any one tell me how can i reload the grid????
Get the data again as you did in the first place and data bind the grid. However, You may consider another approach. Add the new item to the data that is already binded to the grid and put the save button in the grid form. I'm not saying that this approach is better. In this case you can refresh the data by grid.Rows.Refresh method.
Thats what i did but even after the process successfully finish to re assigning the data source to the grid it is not refreshing....means at one time its showing 10 rows now i have inserted one more and when that form get close at that time i am calling the procedure which will reload the data source to the grid but its not working...the grid remain same with the data it was containing
As a testing i created a new Vb.Net project creted a new form and inserted a wingrid.
I did all the same coding which i did in my real project and there when i re assign the data source to the grid from another form its working but not in my application..there is not a single inch of diff in the coding then why its not working not able to understand.
Help Required
Its been a great day testing the wingrid and came to know such strange things that i never thought of.
Since last so many days i was trying to reload the windrid's data source from another form.Now as i mantioned earlier that i am working with an MDI application.
Today what i did is i created a new project add two forms and then try to reload the grid it was wallah it worked.....so i tried the same thing again in my real project but back to squar one. then all of sudden when i thought lets add this testing forms into a MDI and then try.
I added one MDI form make the one form which contaings all the data as child to that MDI and then i call other form and tried to reload ....
know what its not working now there also.....so what i came to know is WINGIRD not getting reloaded in MDI application...
Now what to do??????
I'm not sure exactly what the issue is, but if it works when the two grids are on the same form and does not work when they are on different forms, then my guess is it has something to do with the BindingContext. The DotNet BindingManager uses the containing control as the default BindingContext so that if you have controls on the same form inside the same container bound to the same data source, the controls will stay in synch. But controls in different containers will not.
So perhaps all you have to do is assign all of your controls to have the same BindingContext - perhaps use the BindingContext of the MDI Parent form.
hey mike,
thnx for the reply...well i just went through your answer and u said if it work for controls on same form then it should work controls on other forms.
but mike untli i opt for the MDI application the grid is getting refreshed and reloaded in diff forms also.
its only the case when i put one form in MDI application and then try to reload it from other form then only its not getting reloaded.
Hm, that's odd. I'm afraid I have no idea what's happening there, then.
Perhaps you can duplicate this behavior in a small sample project and Submit an incident to Infragistics Developer Support so they can check it out.
Hey Mike,
As you told me i have uploaded a sample project on the Dev. Support for their look. I am also attaching the same project here also if you feel then plz look into it and check it.
In case you look the project then you need to create a table with the name tblAdvertInfo with the following fields.
AdvertID - int - primary key - set IS Identity on
AdvertTitle - varchar(100)
Media - varchar(50)
AdvertDetail - ntext
CostCentre - varchar(50)
UserName - varchar(20)
UpdateDate - date
Response - ntext
BranchLocation - varchar(50)
Regards