i have two data tables dt1 and dt2,and the result should be present in dt3 and attach to ultragrid using c#
dt1id name1 data12 data2 3 data34 data4
dt2id name1 data52 data6
result should be dt3id name3 data34 data4
Hello,
Thank you for contacting Infragistics Support.
This questions is related to the data source and it is not specific for Infragistics. However In order to subtract the rows of one data table from the rows of another data table you may iterate trough the tables, compare their rows and get the ones you need. You can also use LINQ expression to perform such action. More information about the approach you could find on the following links:
https://social.msdn.microsoft.com/Forums/en-US/1581f5aa-6500-4f40-8591-4b2446fc1c53/how-do-you-get-the-intersection-between-two-data-tables?forum=csharplanguage
http://stackoverflow.com/questions/485306/finding-the-intersection-of-two-net-datatables
Please find attached a sample solution implanting datatable subtract with LINQ expression.
Please let me know if you have any further questions related to Infragistics components
Thanks a lot,it is working as i expected
hi,I have created a datatable dt,with columns id ,name based on grouping hierarchyHere i need to drag and drop the items within grouphierarchy and save itbut problem here is,i have created the datatable dt,from searlization,so there is no database to save the changes so,now how should i save the changes made (drag and drop)in the ultragrid having grouping hierarchy.
hi,im having data in the ultragrid as followsid name1 a2 b3 c4 d5 e6 f7 gi need only row 1,a and 5,e to have a different colori have tried this e.Layout.Bands[0].Columns[2].CellAppearance.BackColor = Color.LightPink; but it is giving entire column as pink. Thanks in advance
Thank you for your feedback.
Here is the answers for your questions:
1. How should i save the changes made (drag and drop)in the ultragrid having grouping hierarchy – you can update your DataTable and then you can serialize it back to its original source.
2. i need only row 1,a and 5,e to have a different color – to change row appearance you need to set the appearance of the row not the appearance of the column. You may use code like this:
ultraGrid.Rows[yourRowIndex].Appearance.BackColor = Color.Red;
Please let me know if you have any further questions.
Hi,
Please let me know if you need my further assistance on this matter.
Thank you for using Infragistics Components.
Regarding your first question please check the forum thread in the link bellow. There is a sample showing how to save and load data table to/from XML file http://es.infragistics.com/community/forums/p/93370/461821.aspx#461821
Regarding your second question please find attached a sample solution implementing this approach.
Can you please provide me the sample code for saving and moreover i tried to change the color of row,it is not working