Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
499 views
Hi, I have the following GridTemplateColumn.  I want to set the width of the CompanyName column to 150px.  I have all the settings I thought I needed but it will won't wrap text? 

<telerik:GridTemplateColumn HeaderStyle-Width="150px"  ItemStyle-Width="150px" ItemStyle-Wrap="true" >
                <ItemTemplate>         
                    <table>
                        <tr>
                            <td style="border:none !important;"><asp:CheckBox ID="CheckBox1" runat="server"  /></td>
                            <td style="border:none !important;"><%# Eval("CompanyName") %></td>
                        </tr>
                    </table>     
                </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks, Dave
Maria Ilieva
Telerik team
 answered on 04 Feb 2013
8 answers
700 views
Hi I am trying to hid / show the footer when a user expands or collapses and item in the grid view, how can I achieve this 

ok so I now have this code


if (gvTakeoff.Items.Expanded == false)
           {
                
               gvTakeoff.MasterTableView.ShowFooter = false;
 
           }
           else
           {
               gvTakeoff.MasterTableView.ShowFooter = true;
           }

if (gvTakeoff.Items[0].Expanded == false)
           {
 
               gvTakeoff.MasterTableView.ShowFooter = false;
 
           }
           else
           {
               gvTakeoff.MasterTableView.ShowFooter = true;
           }
this is only checking the first item in the grid I would like it to test if any items are expanded

I would like it to check if any items are expanded if they are hide the footer, if the item is collapsed then show the footer

thanks

M
Maria Ilieva
Telerik team
 answered on 04 Feb 2013
1 answer
107 views
For my application, I would like to define the structure in an XML file.  I would like the grid to be hierarchical (easily defined in the XML structure) - however, I would like to have a complex layout.

I would like to achieve a NestedViewTemplate (for having a custom panel with HTML layout, or another feature such as the Telerik tab controls within my grid layout)

Is it possible to define something like this and load via XML?  I have the above working without the XML, but I cannot find how to achieve a NestedViewTemplate that is defined in XML.
Radoslav
Telerik team
 answered on 04 Feb 2013
1 answer
128 views
I have a combobox with 5,000+ results - the behavior should be if the user clicks the drop down the first 10 (pre-loaded) should be displayed if the user types it should perform a search/autocomplete and scrolling should be virtual - I don't want to load all 5,000+ results at one time.

Using Q2 2011. I checked out the demos and wasn't sure if this is something the combobox does out of the box or will it require custom code.
Princy
Top achievements
Rank 2
 answered on 04 Feb 2013
0 answers
102 views
Hi All,

I have a radlist box with check boxes options which displays data from Database and when some one selects the data that data is getting stored in the database. (This part is done)

When the User clicks the Back Button I need to show the radlist box with the Data that the user previously selected (How can I do that??)
I need to check the check boxes with the values from the database.
Sima
Top achievements
Rank 1
 asked on 03 Feb 2013
1 answer
92 views
I am not sure why its complicated or maybe im misunderstanding.

I have a custom datasource.
I programmatically add columns and then on ItemDataBound, I get the currentItem and bind the values from the custom object (currentItem) to the columns in the current row being bound. Great.

But now, I want to retrieve the values (potentially modified values) on an "Update" Command.
So I have an OnItemCommand and it does fire.
However, when trying to retrieve the value, I only get an empty HTML space even though the value is there.

Any ideas where I am going wrong?

protected void radGridMenus_OnItemCommand(object sender, GridCommandEventArgs e)
        {
            GridDataItem currentRow = e.Item as GridDataItem;
            if (currentRow != null)
            {
                switch (e.CommandName.ToLower().Trim())
                {
                    case "update":
                            // currentRow["MenuID"].Value - here it is   Not sure why?
                        break;
                    default:
                        break;
                }
            }
        }


Full code:

        protected void Page_Init(object sender, EventArgs e)
        {
            this.DoSetDefaultMenuColumns();
        }
 
        private void DoSetDefaultMenuColumns()
        {
            // lets create the columns.
            GridBoundColumn menuIDColumn = new GridBoundColumn();
            menuIDColumn.HeaderText = "Menu ID";
            menuIDColumn.DataField = "MenuID";
 
            GridBoundColumn menuNameColumn = new GridBoundColumn();
            menuNameColumn.HeaderText = "Menu Name";
            menuNameColumn.DataField = "MenuName";
 
            GridDropDownColumn menuOrderColumn = new GridDropDownColumn();
            menuOrderColumn.HeaderText = "Menu Order ID";
            menuOrderColumn.DataField = "MenuOrderID";
 
            GridDropDownColumn parentIDColumn = new GridDropDownColumn();
            parentIDColumn.HeaderText = "Parent ID";
            parentIDColumn.DataField = "ParentID";
 
            GridCheckBoxColumn isAdminColumn = new GridCheckBoxColumn();
            isAdminColumn.HeaderText = "Is Admin";
            isAdminColumn.DataField = "IsAdmin";
 
            GridBoundColumn pageURLColumn = new GridBoundColumn();
            pageURLColumn.HeaderText = "Page URL";
            pageURLColumn.DataField = "PageURL";
 
            GridCheckBoxColumn employeeAccessColumn = new GridCheckBoxColumn();
            employeeAccessColumn.HeaderText = "Employee Access";
            employeeAccessColumn.DataField = "EmployeeAccess";
 
            GridCheckBoxColumn customerAccessColumn = new GridCheckBoxColumn();
            customerAccessColumn.HeaderText = "Customer Access";
            customerAccessColumn.DataField = "CustomerAccess";
 
            GridButtonColumn updateColumn = new GridButtonColumn();
            updateColumn.ButtonType = GridButtonColumnType.LinkButton;
            updateColumn.HeaderText = "Update";
            updateColumn.Text = "Update Menu Item";
            updateColumn.UniqueName = "UpdateMenuItem";
            updateColumn.CommandName = "Update";
            updateColumn.ItemStyle.ForeColor = Color.Blue;
             
            this.radGridMenus.MasterTableView.Columns.Add(menuIDColumn);
            this.radGridMenus.MasterTableView.Columns.Add(menuNameColumn);
            this.radGridMenus.MasterTableView.Columns.Add(menuOrderColumn);
            this.radGridMenus.MasterTableView.Columns.Add(parentIDColumn);
            this.radGridMenus.MasterTableView.Columns.Add(pageURLColumn);
            this.radGridMenus.MasterTableView.Columns.Add(isAdminColumn);
            this.radGridMenus.MasterTableView.Columns.Add(employeeAccessColumn);
            this.radGridMenus.MasterTableView.Columns.Add(customerAccessColumn);
            this.radGridMenus.MasterTableView.Columns.Add(updateColumn);
        }
 
protected void radGridMenus_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                this.radGridMenus.DataSource = this.CurrentMenuItemsView; // List<T>
            }
        }
 
 protected void radGridMenus_OnItemCommand(object sender, GridCommandEventArgs e)
        {
            GridDataItem currentRow = e.Item as GridDataItem;
            if (currentRow != null)
            {
                switch (e.CommandName.ToLower().Trim())
                {
                    case "update":
 
                        break;
                    default:
                        break;
                }
            }
        }
 
        protected void radGridMenus_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem currentItem = e.Item as GridDataItem;
                var currentMenu = currentItem.DataItem as MProSoftwareMenus;
                if (currentMenu != null)
                {
                    if (currentMenu.ParentID.HasValue)
                    {
                        currentItem["ParentID"].Text = currentMenu.ParentID.Value.ToString();
                    }
 
                    if (currentMenu.MenuOrderID.HasValue)
                    {
                        currentItem["MenuOrderID"].Text = currentMenu.MenuOrderID.Value.ToString();
                    }
                        
                    ((CheckBox)currentItem["IsAdmin"].Controls[0]).Checked = currentMenu.IsAdmin.GetValueOrDefault(false);
 
                    ((LinkButton)currentItem["UpdateMenuItem"].Controls[0]).CommandArgument = currentMenu.MenuID.ToString();
 
                }
            }
        }














Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Feb 2013
1 answer
131 views
Hello,
I wanna remove expand/collapse property when no child items in hierarchical grid.I wanna remove particular cell expand/collapse only
Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Feb 2013
1 answer
214 views
Hello,
I am brand new to RadGrid.
I working on a grid that have only 3 columns.

Firstly, data are retrieved from database into a DataTable, like this:
 static DataTable GetData()
    {
        DataTable table = new DataTable();
        table.Columns.Add("Name", typeof(string));
        table.Columns.Add("Activate", typeof(string));
        table.Columns.Add("Actions", typeof(string));        
 
        table.Rows.Add("Toilets", "Activate", "Duplicate Delete");
        table.Rows.Add("Swimming pools", "Activate", "Duplicate Delete");
        table.Rows.Add("Pumps", "Deactivate", "Duplicate Delete");
        table.Rows.Add("Taps", "", "Duplicate Delete");
        table.Rows.Add("Boiler", "Activate", "Duplicate Delete");
        return table;
    }"

then bind to radgrid using: .DataScource = dataTable;

I want to archive the followings:
1. Active column: i wanna use Image button to render "Activate", "Deactivate" command. When user click those buttons, how can i know from which rows, the buttons were clicked. If the data cell is empty, then do not show any button.
2. I wanna replace Duplicate and Delete with two image buttons inside the same cell.

It seems that i should use ItemTemplate or something like that but after reading documents from telerik, i still can not find out the solution. I am really appreciate your help. Thanks in advanced.
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Feb 2013
1 answer
115 views
Is it possible to add a label/text to the command bar that appears when you have commanditemdisplay="top" in the mastertableview set. See my graphic for a better explanation
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Feb 2013
7 answers
181 views
Hi,

I am getting a selection out of range when binding to a datasource in a formview.  This happens on occasion if the previously saved ID for say a company on the formview no longer exists in the company datasource.

That is fine and I expect an exception to be raised as the company ID does indeed not exist in the datasource.  

I need to be able to intercept that exception with a try / catch and then manually change the empty item text to something like "Invalid company value".  The user can then select a different company.

Because the binding is handled by the formview I'm not sure where to have the try/catch...  

Any suggestions?

Regards,

Jon
Darren
Top achievements
Rank 1
 answered on 01 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?