c# - Hiding repeated rows in telerik RadGrid -
i'm attempting hide duplicate cell values specific columns in telerik radgrid.
i attempted use code below not work. stepping through code debugger, can see appears making right decisions. wondering if method i'm using update cell in incorrect or of i'm missing important step.
private void hidegridduplicates(radgrid radgrid, string[] fieldnames) { var hashlastvalues = new hashtable(); foreach (string fieldname in fieldnames) { foreach (griddataitem item in radgrid.items) { string currentvalue = item.getdatakeyasstring(fieldname); if (hashlastvalues.containskey(fieldname)) if ((string)hashlastvalues[fieldname] == currentvalue) currentvalue = ""; else hashlastvalues[fieldname] = currentvalue; else hashlastvalues.add(fieldname, currentvalue); item[fieldname].text = currentvalue; } } }
update: should looking for:
select expenseid, claimid, [description],transactiondate (select expenseid, claimid, [description],transactiondate, row_number() on (partition claimid order expenseid) rn expense) t rn = 1;
i have tested on own test database , think trying achieve. if change "partition claimid" change column need.
Comments
Post a Comment