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

Multiple questions on GridView

1 Answer 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cherian George
Top achievements
Rank 1
Cherian George asked on 24 May 2010, 05:49 PM
We have been evaluating the GridView for several weeks now and now we have a couple of questions which hopefully somebody can answer

Extending the Context Menu

We have added some extensions to the context menu . However we need to change the Menu Label based on a event click. So far we have not been able to do that. Is that possible ?


Parent/Child Grids

We have a parent child relationship inside a Grid. The grid populates correctly the first time and then we change some of the data in the Child Grid. This causes the Grid to not show any data anymore. Any ideas ?

Saving Preferences

We would like the users to be able to save and store their preferences for the following

1. Column Positions
2. Grouping Preferences
3. Sort Preferences
4. Conditional Formatting Rules

Is this possible

Conditional Formatting based on values in other columns

We would like the user to be able to setup Conditional Formatting rules where the rule is based on another column For eg:- if Shipped Qty > Req Qty (where both these fields are columns of the Grid) then apply the formatting rule.

Is this possible

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 27 May 2010, 03:45 PM
Hello Cherian George,

Thank you for contacting us. Regarding your questions:

1. Extending the Context Menu
Please, refer to that help article for creating custom context menu. In the article "Conditional Custom Context Menus" you can find out how to use individual context menus for different RadGridView elements.

2. Parent/Child Grids
It is not a known issue. Please, provide us with more information about it. It will be best if you can send us a sample project, because this will allow us to investigate the case further.

3. Saving Preferences
You can use the Save/Load layout functionality to store user preferences in a xml file.

4. Conditional Formatting based on values in other columns
You can use the CellFormatting event to achieve formatting, based on values from several columns. Please, consider the code snippet:
this.radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting);
 
// bind RadGridView
 
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
    GridDataCellElement cell = e.CellElement as GridDataCellElement;
    GridViewDataColumn column = e.CellElement.ColumnInfo as GridViewDataColumn;
 
    if (cell != null && column != null && column.UniqueName == "ShippedQty")
    {
        int shippedQty = Convert.ToInt32(cell.Value);
        int reqQty = Convert.ToInt32(cell.RowInfo.Cells[1].Value);
         
        e.CellElement.DrawFill = true;
        e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
 
        if (shippedQty > reqQty)
        {
            e.CellElement.BackColor = Color.Blue;
        }
        else
        {
            e.CellElement.BackColor = Color.Green;
        }
    }
}

I am looking forward to the receiving the details concerning the second question.

Greetings,
Alexander
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
GridView
Asked by
Cherian George
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or