This is a migrated thread and some comments may be shown as answers.

GridBoundColumn unexpected layout

3 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vladimir Gosic
Top achievements
Rank 1
Vladimir Gosic asked on 28 Jun 2010, 10:11 AM
Hello,
I am using RadGrid created programatically in code behing on Page.Init. In the grid I have some GridBoundColumns and some GridTemplateColumns with custom classes as templates. But I have a problem with the GridBoundColumn that displays date. It looks like the whole column is selected, no matter what skin I set. The GridBoundColumn next to it, has the same code except for differences in binding and naming definition. Here is the code for columns (I use the same procedure, but I changed some values like used when creating Date column:

Dim column As GridBoundColumn 
column = New GridBoundColumn() 
 
column.UniqueName = "Date" 
column.DataType = GetType(String
column.HeaderText = PmResources.GetResourceString(headerResourceKey) 
column.HeaderTooltip = PmResources.GetResourceString(toolTipResourceKey) 
column.DataField = "Date" 
column.AutoPostBackOnFilter = False 
column.ShowFilterIcon = False 
column.CurrentFilterFunction = GridKnownFunction.NoFilter 
column.SortExpression = dataField 
column.Groupable = False 
column.AllowFiltering = False 
column.Reorderable = False 
column.Visible = visibile 
column.HeaderStyle.Width = Unit.Pixel(width) 
column.ItemStyle.Width = Unit.Pixel(width) 
column.ReadOnly = isReadOnly 
column.ItemStyle.VerticalAlign = VerticalAlign.Top 
column.ItemStyle.HorizontalAlign = HorizontalAlign.Left 
 
 
 

I am also posting a screenshot of the unexpected layout. I hope you can help me, I am guessing that maybe "Date" is some special name that shouldn't be used in Grid's UniqueName or Binding definition.

Thanks in advance,
Vladimir

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 01 Jul 2010, 09:23 AM
Hello Vladimir,

I followed your scenario n order to replicate the issue you are facing but to no avail. Please find attached a simple test project which is working as expected, examine it and let me know if it helps.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Vladimir Gosic
Top achievements
Rank 1
answered on 01 Jul 2010, 09:59 AM
Hello Pavlina,

Thank you for your answer, but I have already found what was causing the kind of "selected column" layout. It was the fact that I was forcing the grid sorting using that column and I disabled the sorting in the whole grid so I couldn't see clearly that it was causing the column selecting (I couldn't re-sort/turn off sort  of the grid). Now I moved the sorting to the Data layer and removed Sorting in the grid and everything is as expected now.

So the code that was causing it:

Dim expressionDate As GridSortExpression = New GridSortExpression 
expressionDate.FieldName = "Date" 
expressionDate.SetSortOrder("Ascending"
 
MasterTableView.SortExpressions.AddSortExpression(expressionDate) 

with using: Grid.AllowSorting = False




Regards,
Vladimir
0
Pavlina
Telerik team
answered on 01 Jul 2010, 11:04 AM
Hello Vladimir,

I am glad you have resolved your problem. In case you experience any further problems, do not hesitate to contact us again!

All the best,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Vladimir Gosic
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Vladimir Gosic
Top achievements
Rank 1
Share this question
or