Hi All,
Is there any way to to hide repeated columns in ultrawebgrid.
Hi Thanks for your responses..i figured it out by string comparison .
Dim da As New OracleDataAdapter(sString, conn) da.Fill(ds) UltraWebGrid1.DataSource = ds
Dim str1 As String Dim str2 As String Dim i As Integer
str1 = CStr(ds.Tables(0).Rows(i)(0)) Dim j As Integer For j = i + 1 To ds.Tables(0).Rows.Count - 1 str2 = CStr(ds.Tables(0).Rows(j)(0)) If str2 = str1 Then ds.Tables(0).Rows(j)(0) = " " ds.Tables(0).Rows(j)(1) = " "
Else GoTo Exitthisloop End If
NextExitthisloop: i = j - 1 Next
Thanks.
Hi,
If you're asking how to clear out the cells when they are duplicates, you might be interested in the InitializeRow event of the grid. You could check in that event to see when duplicates occur and clear out the cells before they are initialized in the grid. If you're doing this on a few fields, it will get messy either storing the previous values or looping back to find them.
Ed
If you want to remove the rows with values duplicated in a given column, you can hide the individual rows by setting their Hidden properties to true. You'd want to do this after databinding has completed, or after you've added all rows manually to the grid.
Alternately, if you want to leave the rows there but merge cells in the column that have duplicate values, you can set the MergeCells property of the column to true. See the API documentation of the MergeCells property (link leads to online help documentation of NetAdvantage for .NET 2009 Volume 2) for more information.
Hi Vince,
Thanks for your response.my requirement is different .
With in a column , i want to hide the repeated values.
Like following
Col1
t1
t2
I want this column as
t3
That depends on what's causing the columns to be repeated in the first place. It may be as simple as avoiding adding the "duplicate" columns. Alternately, you can set a column's Hidden property to true to hide it while still making it available to client-side code, or you can set its ServerOnly property to true to make it entirely unavailable to the client.