Hi,
I have a situation where after user has typed the data in the first column and pressed tab, a query will be performed and the resulting data should fill the rest of the columns.
Col 1 col2
+-----------------|+------------|---------------|--------------------|
12345 & tab Should populate rest
Thanks.
Hello Joy,
You can hide properties from data binding by using the [Browsable(false)] attribute on the property. So if your class object exposes a public collection property that you don't want to be recognized by the grid, place that attribute on the property and it will hide from the grid.
I hope that this will help you.
Please do not hesitate to contact me if you have any further question.
Thanks Atanas.
Is there any way I can decoreae my view properties so they don't get added to the grid automatically? What is the best way to handle this?
You have a great weekend!
The updated data doesn’t need to bind with the source because we have already binded our UltraGrid with the BindingList and thus each data from the list is binded with the grid. So, when we change the id of the row and press TAB the KeyDown event fires and the changes that occur in the row are visualized in the grid.
I hope that this information will help you.
Hi Atanas,
Thanks so much for your reply. I will give a details reply. But, for now I wanted to let you know that you are absolutey correct about the binding. However, I think the updated data is not available (or does not bing with the source) during keydown event. Am I wrong?
Once you bind a grid to a data source each change of that data source such as adding or deleting items displays in the grid. So, it doesn’t make sense to bind the data source every time you add or delete data from it. Open my sample and notice that the grid is binded just once to the data source. So, could you please modify my sample by adding the data source you bind to the grid? I really need more information about the ‘PurchaseAdviceWizardDataView’ class that you give as a type to your BindingList.
About the update functionality you want to add to your project. As you have already noticed you need to check the index of the row in order to update an existing row. Based on the description you provided I have implemented that functionality in the sample I am sending you. Please see the attached zip.
In order to make a column read only you could use the CellActivation property of the UltraGrid column. More Information could be found here:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=6156
About your second question the event you could use when you tab off from a row is the InitializeRow event. That event fires after the tab is pressed and the rest of the columns are filled with data.
I am sending you the modified sample, and you could run and evaluate it, please see attached zip.
I am waiting for your feedback.