Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
227 views
I need to align a RadMenu to the right. The RadMenu is located in a div element. I can get it to align right with float:right but then that screws up the rest of the formatting on the page because firefox doesn't respect elements contained within a div that use float. Also, my solution needs to not affect other RadMenus that may be on the page because this is in a master page and I can't have the solution mess up RadMenu's that may be hosted in the content pages.
Yana
Telerik team
 answered on 14 Aug 2009
4 answers
54 views
Hi, im using Russell Mason Ribbon Bar and when I add to this ribbon Combobox it doesn't look properly in Internet Explorer, all Comboboxes on that page  have "strange" yellow line below, did someone have the same problem?
Paul
Telerik team
 answered on 14 Aug 2009
1 answer
102 views
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Web.Security;  
using System.Text;  
using System.Data.SqlClient;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using System.Drawing;  
 
public partial class _Default : System.Web.UI.Page  
{  
 
    protected void Page_Load(object sender, System.EventArgs e)  
    {  
 
    }  
    protected override void OnLoad(EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            GetDataFromSession();  
        }  
        else 
        {  
            GetDataFromSession();       
        }  
    }  
 
    private void GetDataFromSession()  
    {  
        DataTable dtTable = new DataTable();  
        string conn = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
        SqlDataAdapter sqladp = new SqlDataAdapter();  
        SqlConnection sqlconn = new SqlConnection(conn);  
        sqlconn.Open();  
        try 
        {  
            string selectQuery = "SELECT [UserID], [Username] FROM [Users] ORDER BY [Username]";  
            sqladp.SelectCommand = new SqlCommand(selectQuery, sqlconn);  
            sqladp.Fill(dtTable);  
            RadGrid1.DataSource = dtTable;  
            RadGrid1.DataBind();  
        }  
        finally 
        {  
            sqlconn.Close();  
        }  
 
    }  
 
 
    protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)  
    {  
        RadGrid1.DataBind();  
    }  
 
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == RadGrid.PerformInsertCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.UpdateCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.DeleteCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.EditCommandName)  
        {  
        }   
    }  
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {      
        if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))  
        {  
            Session.Add("UserID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["UserID"].ToString());  
            GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");  
            GridEditableItem item = (GridEditableItem)e.Item;  
            RadGrid Roles = (RadGrid)item.FindControl("RadGrid2");  
            DataTable dtTable2 = new DataTable();  
            string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
            SqlDataAdapter sqladp2 = new SqlDataAdapter();  
            SqlConnection sqlconn2 = new SqlConnection(conn2);  
            sqlconn2.Open();  
            try 
            {  
                string selectQuery2 = "SELECT [RoleID],[Rolename] FROM [vw_UsersinRoles] WHERE [UserID] = " + Session["UserID"] + " ORDER BY [Username]";  
                sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2);  
                sqladp2.Fill(dtTable2);              
            }  
            finally 
            {  
                sqlconn2.Close();  
            }  
 
            Roles.DataSource = dtTable2;  
            Roles.DataBind();  
            Roles.Visible = true;  
              
        }  
    }  
 
    protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))  
        {  
            Session.Add("RoleID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RoleID"].ToString());  
            GridEditableItem item2 = (GridEditableItem)e.Item;  
            RadGrid Roles2 = (RadGrid)item2.FindControl("RadGrid3");  
            GridEditCommandColumn editColumn2 = (GridEditCommandColumn)Roles2.MasterTableView.GetColumn("EditCommandColumn");     
            DataTable dtTable2 = new DataTable();  
            string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
            SqlDataAdapter sqladp2 = new SqlDataAdapter();  
            SqlConnection sqlconn2 = new SqlConnection(conn2);  
            sqlconn2.Open();  
            try 
            {  
                string selectQuery2 = "SELECT [ClassID], [Classname] FROM [vw_UsersRolesClassesFormsCombined] WHERE [UserID] = " + Session["UserID"] + " ORDER BY [Username]";  
                sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2);  
                sqladp2.Fill(dtTable2);  
            }  
            finally 
            {  
                sqlconn2.Close();  
            }  
            Roles2.DataSource = dtTable2;  
            Roles2.DataBind();  
            Roles2.Visible = true;  
        }  
    }  
 
    protected void RadGrid3_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))  
        {  
            Session.Add("ClassID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ClassID"].ToString());  
            GridEditableItem item3 = (GridEditableItem)e.Item;  
            RadGrid Roles3 = (RadGrid)item3.FindControl("RadGrid4");  
            GridEditCommandColumn editColumn3 = (GridEditCommandColumn)Roles3.MasterTableView.GetColumn("EditCommandColumn");  
            DataTable dtTable2 = new DataTable();  
            string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
            SqlDataAdapter sqladp2 = new SqlDataAdapter();  
            SqlConnection sqlconn2 = new SqlConnection(conn2);  
            sqlconn2.Open();  
            try 
            {  
                string selectQuery2 = "SELECT [FormID], [Formname] FROM [vw_UsersRolesClassesFormsCombined] WHERE [UserID] = " + Session["UserID"] + " AND [ClassID] = " + Session["ClassID"] + "ORDER BY [Username]";  
                sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2);  
                sqladp2.Fill(dtTable2);  
            }  
            finally 
            {  
                sqlconn2.Close();  
            }  
            Roles3.DataSource = dtTable2;  
            Roles3.DataBind();  
            Roles3.Visible = true;  
        }  
 
    }  
 
    protected void RadGrid3_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == RadGrid.PerformInsertCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.UpdateCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.DeleteCommandName)  
        {  
        }  
        else if (e.CommandName == RadGrid.EditCommandName)  
        {  
        }  
    }  
 
 
    protected void RadGrid4_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))  
        {  
            Session.Add("FormID", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["FormID"].ToString());  
            GridEditableItem item3 = (GridEditableItem)e.Item;  
            RadGrid Roles3 = (RadGrid)item3.FindControl("RadGrid4");  
            GridEditCommandColumn editColumn3 = (GridEditCommandColumn)Roles3.MasterTableView.GetColumn("EditCommandColumn");  
            DataTable dtTable2 = new DataTable();  
            string conn2 = ConfigurationManager.ConnectionStrings["SecurityConnectionString"].ToString();  
            SqlDataAdapter sqladp2 = new SqlDataAdapter();  
            SqlConnection sqlconn2 = new SqlConnection(conn2);  
            sqlconn2.Open();  
            try 
            {  
                string selectQuery2 = "SELECT [FormID], [Formname] FROM [vw_UsersRolesClassesFormsCombined] WHERE [UserID] = " + Session["UserID"] + " AND [ClassID] = " + Session["ClassID"] + "ORDER BY [Username]";  
                sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2);  
                sqladp2.Fill(dtTable2);  
            }  
            finally 
            {  
                sqlconn2.Close();  
            }  
            Roles3.DataSource = dtTable2;  
            Roles3.DataBind();  
            Roles3.Visible = true;  
        }  
 
    }  
}  
 
<form id="form1" runat="server">  
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
        AllowSorting="True" GridLines="None" Width="600px" AutoGenerateColumns="false" 
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
        GroupingSettings-CaseSensitive="false" PageSize="20" EnableLinqExpressions="False" 
        OnItemDataBound="RadGrid1_ItemDataBound" ShowStatusBar="True" OnPageIndexChanged="RadGrid1_PageIndexChanged" 
        OnItemCommand="RadGrid1_ItemCommand">  
        <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New User" 
            CommandItemDisplay="TopAndBottom" DataKeyNames="UserID">  
            <CommandItemSettings AddNewRecordText="Add New User"></CommandItemSettings> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridEditCommandColumn HeaderStyle-Width="15px" EditText="View / Edit">  
                    <HeaderStyle Width="15px"></HeaderStyle> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridTemplateColumn UniqueName="DeleteColumn" ItemStyle-Width="16px" AllowFiltering="false">  
                    <HeaderStyle Width="16px" /> 
                    <ItemTemplate> 
                        <asp:ImageButton ID="imgbtnDelete" Width="14px" ToolTip="Delete Contact" runat="server" 
                            CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> 
                    </ItemTemplate> 
                    <ItemStyle Width="16px"></ItemStyle> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="Username" HeaderText="Username" SortExpression="Username" 
                    UniqueName="Username">  
                </telerik:GridBoundColumn> 
            </Columns> 
            <EditFormSettings CaptionFormatString="Edit details for User {0}" EditFormType="Template">  
                <EditColumn UniqueName="EditCommandColumn1">  
                </EditColumn> 
                <FormTemplate> 
                    <table> 
                        <tr> 
                            <td> 
                                <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True" 
                                    GridLines="None" AutoGenerateColumns="false" AllowAutomaticDeletes="True" OnItemDataBound="RadGrid2_ItemDataBound" 
                                    AllowAutomaticInserts="True" AllowAutomaticUpdates="True" PageSize="20" Width="500px" 
                                    ShowStatusBar="True">  
                                    <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Role" 
                                        CommandItemDisplay="TopAndBottom" DataKeyNames="RoleID">  
                                        <CommandItemSettings AddNewRecordText="Add New Role"></CommandItemSettings> 
                                        <RowIndicatorColumn> 
                                            <HeaderStyle Width="20px"></HeaderStyle> 
                                        </RowIndicatorColumn> 
                                        <ExpandCollapseColumn> 
                                            <HeaderStyle Width="20px"></HeaderStyle> 
                                        </ExpandCollapseColumn> 
                                        <Columns> 
                                            <telerik:GridEditCommandColumn HeaderStyle-Width="15px" EditText="View / Edit">  
                                                <HeaderStyle Width="15px"></HeaderStyle> 
                                            </telerik:GridEditCommandColumn> 
                                            <telerik:GridTemplateColumn UniqueName="DeleteColumn2" ItemStyle-Width="16px" AllowFiltering="false">  
                                                <HeaderStyle Width="16px" /> 
                                                <ItemTemplate> 
                                                    <asp:ImageButton ID="imgbtnDelete2" Width="14px" ToolTip="Delete Contact" runat="server" 
                                                        CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> 
                                                </ItemTemplate> 
                                                <ItemStyle Width="16px"></ItemStyle> 
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridBoundColumn DataField="Rolename" HeaderText="Rolename" SortExpression="Rolename" 
                                                UniqueName="Rolename">  
                                            </telerik:GridBoundColumn> 
                                        </Columns> 
                                        <EditFormSettings CaptionFormatString="Edit details for User {0}" EditFormType="Template">  
                                            <EditColumn UniqueName="EditCommandColumn2">  
                                            </EditColumn> 
                                            <FormTemplate>   
                                                <table> 
                                                    <tr> 
                                                        <td> 
                                                            <telerik:RadGrid ID="RadGrid3" runat="server" AllowPaging="True" 
                                                                GridLines="None" AutoGenerateColumns="false" AllowAutomaticDeletes="True" OnItemDataBound="RadGrid3_ItemDataBound" OnItemCommand="RadGrid3_ItemCommand" 
                                                                AllowAutomaticInserts="True" AllowAutomaticUpdates="True" GroupingSettings-CaseSensitive="false" 
                                                                PageSize="20" EnableLinqExpressions="False" Width="400px" ShowStatusBar="True">  
                                                                <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Class" 
                                                                    CommandItemDisplay="TopAndBottom" > 
                                                                    <CommandItemSettings AddNewRecordText="Add New Class"></CommandItemSettings> 
                                                                    <RowIndicatorColumn> 
                                                                        <HeaderStyle Width="20px"></HeaderStyle> 
                                                                    </RowIndicatorColumn> 
                                                                    <ExpandCollapseColumn> 
                                                                        <HeaderStyle Width="20px"></HeaderStyle> 
                                                                    </ExpandCollapseColumn> 
                                                                    <Columns> 
                                                                        <telerik:GridEditCommandColumn HeaderStyle-Width="15px" EditText="View / Edit">  
                                                                            <HeaderStyle Width="15px"></HeaderStyle> 
                                                                        </telerik:GridEditCommandColumn> 
                                                                        <telerik:GridTemplateColumn UniqueName="DeleteColumn3" ItemStyle-Width="16px" AllowFiltering="false">  
                                                                            <HeaderStyle Width="16px" /> 
                                                                            <ItemTemplate> 
                                                                                <asp:ImageButton ID="imgbtnDelete3" Width="14px" ToolTip="Delete Contact" runat="server" 
                                                                                    CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> 
                                                                            </ItemTemplate> 
                                                                            <ItemStyle Width="16px"></ItemStyle> 
                                                                        </telerik:GridTemplateColumn> 
                                                                        <telerik:GridBoundColumn DataField="Classname" HeaderText="Classname" SortExpression="Classname" 
                                                                            UniqueName="Classname">  
                                                                        </telerik:GridBoundColumn> 
                                                                    </Columns> 
                                                                    <EditFormSettings CaptionFormatString="Edit details for User {0}" EditFormType="Template">  
                                                                        <EditColumn UniqueName="EditCommandColumn3">  
                                                                        </EditColumn> 
                                                                        <FormTemplate> 
                                                                            <table> 
                                                                                <tr> 
                                                                                    <td> 
                                                                                        <telerik:RadGrid ID="RadGrid4" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
                                                                                            GridLines="None" AutoGenerateColumns="false" AllowAutomaticDeletes="True" OnItemDataBound="RadGrid4_ItemDataBound" 
                                                                                            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" GroupingSettings-CaseSensitive="false" 
                                                                                            PageSize="20" EnableLinqExpressions="False" Width="300px" ShowStatusBar="True">  
                                                                                            <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Form" 
                                                                                                CommandItemDisplay="TopAndBottom" DataKeyNames="FormID">  
                                                                                                <CommandItemSettings AddNewRecordText="Add New Form"></CommandItemSettings> 
                                                                                                <RowIndicatorColumn> 
                                                                                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                                                                                </RowIndicatorColumn> 
                                                                                                <ExpandCollapseColumn> 
                                                                                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                                                                                </ExpandCollapseColumn> 
                                                                                                <Columns> 
                                                                                                      
                                                                                                    <telerik:GridTemplateColumn UniqueName="DeleteColumn4" ItemStyle-Width="16px" AllowFiltering="false">  
                                                                                                        <HeaderStyle Width="16px" /> 
                                                                                                        <ItemTemplate> 
                                                                                                            <asp:ImageButton ID="imgbtnDelete4" Width="14px" ToolTip="Delete Contact" runat="server" 
                                                                                                                CommandName="Delete" ImageUrl="~/images/recycle.jpg" OnClientClick="javascript:if(!confirm('This action will delete the selected contact. Are you sure?')){return false;}" /> 
                                                                                                        </ItemTemplate> 
                                                                                                        <ItemStyle Width="16px"></ItemStyle> 
                                                                                                    </telerik:GridTemplateColumn> 
                                                                                                    <telerik:GridBoundColumn DataField="Formname" HeaderText="Formname" SortExpression="Formname" 
                                                                                                        UniqueName="Formname">  
                                                                                                    </telerik:GridBoundColumn> 
                                                                                                </Columns> 
                                                                                                  
                                                                                                <NoRecordsTemplate> 
                                                                                                    No Records</NoRecordsTemplate> 
                                                                                            </MasterTableView> 
                                                                                        </telerik:RadGrid> 
                                                                                    </td> 
                                                                                </tr> 
                                                                                <tr> 
                                                                                    <td> 
                                                                                        <asp:Button ID="btnUpdate3" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                                                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
                                                                                        </asp:Button>&nbsp;  
                                                                                        <asp:Button ID="btnCancel3" Text="Cancel" runat="server" CausesValidation="False" 
                                                                                            CommandName="Cancel"></asp:Button> 
                                                                                    </td> 
                                                                                </tr> 
                                                                                <table> 
                                                                        </FormTemplate> 
                                                                    </EditFormSettings> 
                                                                    <NoRecordsTemplate> 
                                                                        No Records</NoRecordsTemplate> 
                                                                </MasterTableView> 
                                                            </telerik:RadGrid> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td> 
                                                            <asp:Button ID="btnUpdate2" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
                                                            </asp:Button>&nbsp;  
                                                            <asp:Button ID="btnCancel2" Text="Cancel" runat="server" CausesValidation="False" 
                                                                CommandName="Cancel"></asp:Button> 
                                                        </td> 
                                                    </tr> 
                                                    <table> 
                                            </FormTemplate> 
                                        </EditFormSettings> 
                                        <NoRecordsTemplate> 
                                            No Records</NoRecordsTemplate> 
                                    </MasterTableView> 
                                                            </telerik:RadGrid> 
                                                        
                            </td> 
                        </tr> 
                        <tr> 
                            <td> 
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
                                </asp:Button>&nbsp;  
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 
                                    CommandName="Cancel"></asp:Button> 
                            </td> 
                        </tr> 
                        <table> 
                </FormTemplate> 
            </EditFormSettings> 
            <NoRecordsTemplate> 
                No Records</NoRecordsTemplate> 
        </MasterTableView> 
        <GroupingSettings CaseSensitive="False"></GroupingSettings> 
    </telerik:RadGrid> 
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
</form> 

RadGrid1 fires perfect, RadGrid2 fires perfect, and RadGrid3 loads but when editing the command never fires.  I set my break point and only hits when loads but not when hit the view / edit.  Thanks in advance.
Mira
Telerik team
 answered on 14 Aug 2009
3 answers
109 views
Hello,

My tree view has got nodes with context menu item "Edit node". I'd like to trigger the same event (simulate clicking on the context menu item) by double clicking on the node in the tree.

Is it possible? Please help ...

Regards,
Kamil - Folding Space
Atanas Korchev
Telerik team
 answered on 14 Aug 2009
4 answers
191 views
I'm trying to use the Automatic Update/Insert/Delete to save a lot of time, however I'm stuck with a grid that will not populate the DropDownList. When I go into edit mode, the dropdown displays a blank list but the ddList is populated in the c# code. What am I doing wrong?

<MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="Make,Model">  
                <Columns> 
                    <telerik:GridDropDownColumn ColumnEditorID="Make"   
                                                DataField="Make" 
                                                DataType="System.String"    
                                                Display="true"    
                                                DropDownControlType="RadComboBox"   
                                                HeaderText="Make" 
                                                ReadOnly="false"   
                                                SortExpression="Make"   
                                                UniqueName="Make">  
                    </telerik:GridDropDownColumn> 
                </Columns> 
                <EditFormSettings CaptionFormatString="Edit " 
                    PopUpSettings-Modal="true" /> 
            </MasterTableView> 



This is the code behind on the ItemDataBound

        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))  
        {  
            GridEditableItem eeditedItem = e.Item as GridEditableItem;  
            GridEditManager editMan = editedItem.EditManager;  
            GridDropDownListColumnEditor editor = editMan.GetColumnEditor("Make") as GridDropDownListColumnEditor;                  
 
            DataTable data = new DataTable();  
            SqlConnection conn = null;  
 
            conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Demo Database NAV (6-0)ConnectionString"].ConnectionString);  
            conn.Open();  
 
            SqlCommand cmd = new SqlCommand("Makes", conn);  
            cmd.CommandType = CommandType.StoredProcedure;  
            cmd.Parameters.Add(new SqlParameter("@strCriteriaMake", Convert.ToString(editor.SelectedValue).ToUpper()));  
 
            using (SqlDataAdapter da = new SqlDataAdapter(cmd))  
            {  
                da.Fill(data);  
            }  
 
            DropDownList ddList = editor.DropDownListControl;  
            for (int i = 0; i < data.Rows.Count; i++)  
            {  
                ddList.Items.Add(data.Rows[i]["Make"].ToString());  
            }  
              
            ddList.DataBind();  
        } 

Regards

Steve
Princy
Top achievements
Rank 2
 answered on 14 Aug 2009
2 answers
256 views
Hi,

RadWindow architecture is very tied to IFrame since the content is a page.

This is interesting but the communication between page and windows (or between parent and child windows) is not very user friendly (JavaScript, etc.)

Is their any chance to put directly ASPX inside RadWindow in a next version, just like we're doing for RadTooltip ? With a RadAjaxPanel inside RadWindow the behaviour should be the same.

Best regards,

Florian DREVET
Nicolaï
Top achievements
Rank 2
 answered on 14 Aug 2009
4 answers
132 views
Hi,

I'm in the middle of trying to get an idea of how the telerik components work and if they can fit my future projects.
concering the radcombobox the load on demand feature seems pretty funky, so i've tried it out in a sample project.
I found out that the behaveour changed slightly, but to such a degree that it could potentially confuse users.
It seems that after enabeling load on demand the way a user can select an item from the dropdownlist changes.
Without load on demand the user can simply click anywhere in the dropdownlist to select the desired item. After enabeling he can only select the item by clicking on the item text! He can't click on the blank area behind the text.

This can be experienced also by using one of the examples of load on demand: http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx

Can anybody tell me how to enable load on demand without losing the click anywhere in the dropdownlist feature?
koen van daalen
Top achievements
Rank 1
 answered on 14 Aug 2009
2 answers
172 views
Hi

I am having radtimepicker inside a asp.net gridview.
OnRowDatabound of gridview in the code behind I attached "OnClientTimeSelected" event of radtimepicker.
I am having a javascript function
But that function is not getting called.
Please tell me proper solution for this.

This is the sample code

               aspx page
------------------------------

                     <asp:GridView runat="server" ID="gvWorkingHours_New" AutoGenerateColumns="false"
                                    OnRowDataBound="gvWorkingHours_New_RowDataBound">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Slot Name">
                                                <ItemTemplate>
                                                    <asp:TextBox runat="server" ID="txtSlotName" CssClass="inputsNoExpression" Text='<%# Eval("SlotName") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="From Time">
                                                <ItemTemplate>
                                                    <radCln:RadTimePicker ID="ddlFromTimeHrs" Width="31%" runat="server" TabIndex="2"
                                                        EnableTyping="true" TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm"
                                                        DateInput-DisplayDateFormat="HH:mm" DateInput-EmptyMessage="From Time">
                                                        <TimeView ID="TimeView1" runat="server" ShowHeader="False" Interval="00:30" Columns="4" OnClientTimeSelected="sree()">
                                                        </TimeView>
                                                    </radCln:RadTimePicker>
                                                    <font class="sf-lab">hrs</font>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="To Time">
                                                <ItemTemplate>                                               
                                                  <radCln:RadTimePicker ID="ddlToTimeHrs" Width="31%" runat="server" TabIndex="2"
                                                        EnableTyping="true" TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm"
                                                        DateInput-DisplayDateFormat="HH:mm" DateInput-EmptyMessage="From Time">
                                                        <TimeView ID="TimeView1" runat="server" ShowHeader="False" Interval="00:30" Columns="4">
                                                        </TimeView>
                                                    </radCln:RadTimePicker>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                         
                                        </Columns>
                                        <HeaderStyle CssClass="sf-formlabel" />
                                    </asp:GridView>
                           
                                   
--------

aspx.cs file
protected void gvWorkingHours_New_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        DataRowView drv = e.Row.DataItem as DataRowView;
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            RadTimePicker ddlFromTimeHrs = (RadTimePicker)e.Row.FindControl("ddlFromTimeHrs");
            RadTimePicker ddlToTimeHrs = (RadTimePicker)e.Row.FindControl("ddlToTimeHrs");

            ((RadTimePicker)e.Row.FindControl("ddlFromTimeHrs")).Attributes.Add("OnClientTimeSelected", "javascript:return CheckValidTimeHrs_New(" + ddlFromTimeHrs.ClientID + "," +
                ddlToTimeHrs.ClientID + ",1" + ")");

            ((RadTimePicker)e.Row.FindControl("ddlToTimeHrs")).Attributes.Add("OnClientTimeSelected", "javascript:return CheckValidTimeHrs_New(" + ddlFromTimeHrs.ClientID + "," +
                ddlToTimeHrs.ClientID + ",2" + ")");

        
         
        }
    }

---

javascript function

CheckValidTimeHrs_New(value1,value2,value3)
{
alert('Onclienttimeselected');
}



Regards
Sreedhar Ambati
sreedhar ambati
Top achievements
Rank 1
 answered on 14 Aug 2009
1 answer
127 views
Hello ,

        I have a issue in arranging RadGrid columns , which will be dynamically added at runtime. No of columns differ from time to time.
       When i tried with TableLayout fixed i have all columns fixed in size but the date columns are appearing shrinked with out the calender control.
      When i tried removing TableLayout fixed for mastertableview all columns based on column length either come together if less or stetch if more no of columns. 
      Can any one suggest how to align the columns accordingly with the no of columns.
   
Thanks & Regards,
Satya.
 
Daniel
Telerik team
 answered on 14 Aug 2009
0 answers
157 views

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

 

 

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <rad:RadGrid ID="gvWorkingHours_New" runat="server" Skin="SkeltaGrid" AutoGenerateColumns="false"
            OnItemDataBound = "gvWorkingHours_New_OnItemDataBound">
                <MasterTableView>
                    <Columns>
                     <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:TextBox runat="server" ID="txtSlotName"
                                CssClass="inputsNoExpression"  Text='<%# Eval("SlotName") %>'></asp:TextBox>
                           
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                        <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <radCln:RadTimePicker ID="rtpFromTime" Width="31%" runat="server" TabIndex="2"
                                    EnableTyping="true" TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm"
                                    DateInput-DisplayDateFormat="HH:mm" DateInput-EmptyMessage="From Time"
                                    DBSelectedDate='<%# Eval("FromTime") %>'>
                                    <TimeView ID="tvFrom" runat="server" ShowHeader="False" Interval="00:30" Columns="3"                                                                    >
                                    </TimeView>
                                </radCln:RadTimePicker>
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                        <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <radCln:RadTimePicker ID="rtpToTime" Width="31%" runat="server" TabIndex="2"
                                    EnableTyping="true" TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm"
                                    DateInput-DisplayDateFormat="HH:mm" DateInput-EmptyMessage="To Time"
                                     DBSelectedDate='<%# Eval("ToTime") %>'>
                                    <TimeView ID="tvTo" runat="server" ShowHeader="False" Interval="00:30" Columns="3"
                                     >
                                    </TimeView>
                                </radCln:RadTimePicker>
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </rad:RadGrid>
             <asp:LinkButton ID="LinkButton1" runat="server" OnClick="lnkbtnAddSlot_New_Click" Width="97px"
              CssClass="sf-inputsLinkButton" OnClientClick="return AddSlot_New()">Add Slot_New</asp:LinkButton>
        </div>
    </form>
</body>
</html>

 

code behind
----------

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SetInitialRowForSlots_New();
        }
    }
    private void SetInitialRowForSlots_New()
    {
        DataTable dtSlots = new DataTable();
        dtSlots.Columns.Add(new DataColumn("SlotName", typeof(string)));
        dtSlots.Columns.Add(new DataColumn("FromTime", typeof(string)));
        dtSlots.Columns.Add(new DataColumn("ToTime", typeof(string)));

        DataRow drSlot = dtSlots.NewRow();
        drSlot["SlotName"] = string.Empty;
        drSlot["FromTime"] = new TimeSpan(0, 0, 0);
        drSlot["ToTime"] = new TimeSpan(0, 0, 0);
        dtSlots.Rows.Add(drSlot);

        gvWorkingHours_New.DataSource = dtSlots;
        gvWorkingHours_New.DataBind();
    }

    protected void lnkbtnAddSlot_New_Click(object sender, EventArgs e)
    {
        DataTable dtSlots = new DataTable();
        dtSlots.Columns.Add(new DataColumn("SlotName", typeof(string)));
        dtSlots.Columns.Add(new DataColumn("FromTime", typeof(string)));
        dtSlots.Columns.Add(new DataColumn("ToTime", typeof(string)));

        foreach (GridDataItem pkgItem in gvWorkingHours_New.MasterTableView.Items)
        {           
            TextBox SlotName = pkgItem.FindControl("txtSlotName") as TextBox;
            RadTimePicker FrTime = pkgItem.FindControl("rtpFromTime") as RadTimePicker;
            RadTimePicker ToTime = pkgItem.FindControl("rtpToTime") as RadTimePicker;

            DataRow dr = dtSlots.NewRow();
            dr["SlotName"] = SlotName.Text;
            dr["FromTime"] = new TimeSpan(((DateTime)(FrTime.DbSelectedDate)).TimeOfDay.Hours, ((DateTime)(FrTime.DbSelectedDate)).TimeOfDay.Minutes, 0);
            dr["ToTime"] = new TimeSpan(((DateTime)(ToTime.DbSelectedDate)).TimeOfDay.Hours, ((DateTime)(ToTime.DbSelectedDate)).TimeOfDay.Minutes, 0);

            dtSlots.Rows.Add(dr);
        }
        DataRow drEmpty = dtSlots.NewRow();
        drEmpty["SlotName"] = string.Empty;
        drEmpty["FromTime"] = new TimeSpan(0, 0, 0);
        drEmpty["ToTime"] = new TimeSpan(0, 0, 0);

        dtSlots.Rows.Add(drEmpty);
        gvWorkingHours_New.DataSource = dtSlots;
        gvWorkingHours_New.DataBind();
    }

    protected void  gvWorkingHours_New_OnItemDataBound(object sender, GridItemEventArgs e)
    {
      

        if (e.Item.ItemType  == GridItemType.Item)
        {
            DataRowView dr = (DataRowView)e.Item.DataItem;
            if (dr != null)
            {
              
                RadTimePicker rtpFrom = (RadTimePicker)e.Item.FindControl("rtpFromTime");
              
                //((RadTimePicker)e.Item.FindControl("rtpFrom")).Attributes.Add("OnClientTimeSelected", "javascript:return sree(" + tvFrom.ClientID + ")");

               
             

           
            }
        }

    }





Hi

I placed two radtimepickers (fromtime and totime) inside a radgrid and want to validate in javascript (FromTime should be less than ToTime. I want to show this message in an alert whenever user gives invalid time)
How to achieve this?
I tried attaching onclienttimeselected in onitemdatabound but it is not firing
Please help me

Regards
Sreedhar Ambati

sreedhar ambati
Top achievements
Rank 1
 asked on 14 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?