I have a XamDataGrid that is being used to display data from 3 different sources based on the button click. Here i am trying to bind the DataSource of the XamDataGrid from code behind. The fields from each source are different, so i can not define the field layout in Xaml.
After i bind the DataSource, how can i access the columns of the grid to make them visible or invisible based on the user input? Any suggestions to do this?
Hello Sagar,
Thank you for the feedback. I can see that Stefan has already answered to these threads. Please feel free to let me know if you have any further questions on how to add manually add information on a hidden column.
Thanks Gergana.
I have couple more questions, which i have asked as seperate threads, can you please look at them as well? Here are the links:
http://es.infragistics.com/community/forums/p/90411/447093.aspx#447093
http://es.infragistics.com/community/forums/p/90409/447092.aspx#447092
Thanking you in advance.
Sagar.
I have been looking into your question. I have modified the last attached sample application for you. In the sample I have handled the RecordAdded event. Then I am getting the ChildData from the event arguments. Then I am setting the value manually to the “Description” filed.
In order to test this functionality I have added a FieldChooser to the XamDataGrid. Please hide the “Description” field using the FieldChooser. Then add a new record to the child table. After the record is added please show the “Description” column using the FieldChooser again.
Also, in case you have other question different that the title of this forum post, please create a different forum thread for each of your questions. This helps us tracking the communication. Also other community members can benefit from these threads too.
Please find the attached sample application and feel free to let me know if you have any further questions on how to add manually add information on a hidden column.
Hi Gergana,
Thanks for the reply to my previous post. It was very helpful. I have another question. I am trying to add a new record (insert) a new record for LOBAllocation table. The grid displays all fields except AuditUser and AduitDate. I need to insert these fields values from code behind. I am truing to add the data from the following event:
private void ExpenseLedgerPlanGrid_RecordAdded (object sender, Infragistics.Windows.DataPresenter.Events.RecordAddedEventArgs e) { ((sender as XamDataGrid).ActiveRecord as DataRecord).Cells["AuditUser"].Value = "N0004"; }
This is not working, Am i missing something? The table i am adding the new record is the child table of another table. I am not able to access it from code behind. any suggestions?
I also tried to bind the ActiveDataItem = {Binding ActiveRecord} and i see that, this is invoked only if i am on the root table. When i select the rocord of a child or inner table, this dosent work. Any suggestions?
Can you please tell me how can change/insert new values from code behind? I have the screen image below:
HIi