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

RadGridView Filtering issue

2 Answers 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 02 Jun 2010, 09:27 PM

I am experiencing some issues with allowing the user to filter data in the grid. We are using Telerik.WinControls.GridView, v8.2.0.0. In the designer, i have the following code:

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn1);

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn2);

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn3);

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn4);

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn5);

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn6);

 

 

this.grdAuditDetails.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn7);

 

 

this.grdAuditDetails.EnableFiltering = true;

 

 

this.grdAuditDetails.MasterGridViewTemplate.EnableFiltering = true;

 

 

this.grdAuditDetails.MasterGridViewTemplate.EnableGrouping = false;

 

 

this.grdAuditDetails.MultiSelect = false;

 

 

this.grdAuditDetails.Name = "grdAuditDetails";

 

 

this.grdAuditDetails.ReadOnly = true;

 

 

this.grdAuditDetails.RightToLeft = System.Windows.Forms.RightToLeft.No;

 

 

//

 

 

//

 

 

//

 

 

this.grdAuditDetails.RootElement.ForeColor = System.Drawing.SystemColors.GradientActiveCaption;

 

 

this.grdAuditDetails.ShowGroupPanel = false;

 

 

this.grdAuditDetails.Size = new System.Drawing.Size(791, 590);

 

 

this.grdAuditDetails.TabIndex = 94;

 

 

this.grdAuditDetails.TabStop = false;

 

 

this.grdAuditDetails.Text = "radGridViewPreview";

 

 

this.grdAuditDetails.ThemeName = "Breeze";

 

((Telerik.WinControls.UI.

GridTableElement)(this.grdAuditDetails.GetChildAt(0))).CellSpacing = -1;

 

((Telerik.WinControls.UI.

GridTableElement)(this.grdAuditDetails.GetChildAt(0))).TableHeaderHeight = 26;

 

((Telerik.WinControls.UI.

GridTableElement)(this.grdAuditDetails.GetChildAt(0))).BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(246)))));

 

((Telerik.WinControls.UI.

GridTableElement)(this.grdAuditDetails.GetChildAt(0))).Padding = new System.Windows.Forms.Padding(3);

 

 

On the form, i can see the filter icons for the fields, but when the user speicifies how they want to filter and add their criteria, nothing happens. Can anyone please help me out with this issue?

Thanks!

Craig

2 Answers, 1 is accepted

Sort by
0
Accepted
MP
Top achievements
Rank 1
answered on 02 Jun 2010, 10:33 PM
We had faced a similar issue early on. It happened when the column FieldAlias and UniqueName didn't match. Check your designer for the following
gridViewColumn1.FieldAlias = "colEmployeeName";  
gridViewColumn1.FieldName = "Emp_Name";  
gridViewColumn1.UniqueName = "colEmployeeName"

Ensure that the FieldAlias and the UniqueName match. By default, the Property Builder sets the UniqueName as same as the FieldName instead of the FieldAlias. I don't know whether this is a bug and whether the UniqueName needs to be exposed at all to the developers.

Regards,
MP
0
Craig
Top achievements
Rank 1
answered on 03 Jun 2010, 01:40 PM
Matching the field alias with the unique name corrected the issue, and the sorting is working well now. Thanks for the help!

Craig
Tags
GridView
Asked by
Craig
Top achievements
Rank 1
Answers by
MP
Top achievements
Rank 1
Craig
Top achievements
Rank 1
Share this question
or