Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
343 views
Hi,
I have a grid with a column with checkboxes in it. I need to remove the checkboxes for some rows and replace them with text. In the DataBindRow event I have code like this :-

    TableCell Cell = Item["Select"];
    Cell.Controls.Clear();
    Label lb = new Label();
    lb.Text = Msg;
    Cell.Controls.Add(lb);

This works and the page looks fine. Until I do a postback on a button click. After the postback the grid now has check boxes on all rows - the rows that had them removed have them all back again. And the data bind was not even called on the postback.

Any ideas?

Clayton
skysailor
Top achievements
Rank 1
 answered on 11 Aug 2009
1 answer
96 views
I have a rad panel that could have four items with static children depending on the user. Basically I need to check the user's role, and then based on that, I decide what panels should be loaded. I have seen some demos on visual basic and the panel bar but everytime I click on the link the page pulls up a server error. Can someone point me to some directions on how to add items to a radpanel through visual basic? Thanks,
Web Services
Top achievements
Rank 2
 answered on 11 Aug 2009
2 answers
328 views
I have an asp:DropDownListlist control that when a specific value is selected, a panel containing a textbox is shown or hidden using JavaScript. This works OK.

When I replace the asp:DropDownList control with the rad combobox control, the panel is permanently hidden.

I thought it may have someting to do with the onchange event (line 13 below), so I played around, changing that to OnClientSelectedIndexChanged & onclientitemrequested (and other things), but to no avail.

If someone could give me a hand in getting this code to work with the combobox, I would be greatly appreciated.

Here is my server side code:
protected void FormViewSkillDetails_DataBound(object sender, EventArgs e)  
    {  
        //START: CODE REQUIREMENTS OF THE INSERT ITEM TEMPLATE OF THE FORM VIEW CONTROL.  
        if (FormViewSkillDetails.CurrentMode == FormViewMode.Insert)  
        {  
            FormViewSkillDetails.Focus(); //place the cursor on the 1st available field of the form view.  
        
            //START: HIDE / SHOW THE INSERT SKILL OWN HEADING DETERMINED BY THE VALUE IN THE DROP DOWN LIST.  
            RadComboBox ddl = (RadComboBox)FormViewSkillDetails.FindControl("RadComboBoxSkillTypeInsertDisplay");  
            Panel p = (Panel)FormViewSkillDetails.FindControl("PanelSkillOwnHeadingInsertItem");  
            RequiredFieldValidator rfv = (RequiredFieldValidator)FormViewSkillDetails.FindControl("RequiredFieldValidatorClientSideSkillOwnHeadingInsert");  
            CustomValidator cvss = (CustomValidator)FormViewSkillDetails.FindControl("CustomValidatorServerSideSkillOwnHeadingInsertItemBlank");  
            ddl.Attributes.Add("onchange", "JavaScript:selectInputInsertChange('" + ddl.ClientID + "', '" + p.ClientID + "', '" + rfv.ClientID + "', '" + cvss.ClientID + "');");  
            
            //FINISH: HIDE / SHOW THE INSERT SKILL OWN HEADING DETERMINED BY THE VALUE IN THE DROP DOWN LIST.     
        }  
        //FINISH: CODE REQUIREMENTS OF THE INSERT ITEM TEMPLATE OF THE FORM VIEW CONTROL.  
    } 

Here is my javascript code:
    <script type="text/javascript">  
        function selectInputInsertChange(ddl_id, pan_id, rfv_id, cvss_id) {  
        var ddl = document.getElementById(ddl_id);  
        var pan = document.getElementById(pan_id);  
        var rfv = document.getElementById(rfv_id);  
        var cvss = document.getElementById(cvss_id);  
        if (ddl.value == "817") {  
            pan.style.display = 'inline';  
            ddl.focus();  
            rfv.enabled = true;  
            cvss.enabled = true;  
        }  
        else {  
            pan.style.display = 'none';  
            ddl.focus();  
            rfv.enabled = false;  
            cvss.enabled = false;  
        }  
    }  
    </script> 

Here is my aspx code:
(This code is inside a form view insert item template and I have left the asp:DropDownList control in the code for reference)
                            <telerik:RadComboBox ID="RadComboBoxSkillTypeInsertDisplay"   
                                                                     DataSourceID="ObjectDataSourceSkillDetailsSkillType"   
                                                                     DataTextField="SkillTypeDescriptionIntl"   
                                                                     DataValueField="SkillTypeID"   
                                                                     Dir="<%$ Resources:Resource, TextDirection %>"    
                                                                     Runat="server"   
                                                                     SelectedValue='<%# Bind("SkillTypeID")%>'   
                                                                     Skin="Black" /> 
                              
                            <asp:DropDownList ID="DropDownListSkillTypeInsertDisplay"   
                                                                CssClass="si"   
                                                                DataSourceID="ObjectDataSourceSkillDetailsSkillType"   
                                                                DataTextField="SkillTypeDescriptionIntl"   
                                                                DataValueField="SkillTypeID"    
                                                                onBlur="TBC(this,0)"   
                                                                onFocus="TBC(this,1)"   
                                                                Runat="Server"   
                                                                SkinID="DropDownListStandard" /> 
                                                                  
                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorRadComboBoxSkillTypeInsertDisplay" ControlToValidate="RadComboBoxSkillTypeInsertDisplay" Display="None" EnableClientScript="true" ErrorMessage="<%$ Resources:SkillErrorMessageSkillType.Text %>" InitialValue="0" Runat="Server" SetFocusOnError="true" /> 
                            <asp:Image ID="ImageRequiredSkillTypeInsertItem" BorderWidth="0" ImageUrl="~/Images/icon_required.gif" Runat="Server" /> 
                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorSkillTypeInsert" ControlToValidate="DropDownListSkillTypeInsertDisplay" Display="None" EnableClientScript="true" ErrorMessage="<%$ Resources:SkillErrorMessageSkillType.Text %>" InitialValue="0" Runat="Server" SetFocusOnError="true" /> 
                        </div> 
                    </div> 
                      
                    <asp:Panel ID="PanelSkillOwnHeadingInsertItem" CssClass="noFlickering" runat="server" > 
                        <div class="standardDisplay">  
                            <div class="prompt_right_insert_20">  
                                <asp:Label ID="LabelSkillOwnHeadingInsertItemPrompt" Runat="Server" Text="<%$ Resources:SkillPromptOwnSkillType.Text %>" Visible="false" /> 
                            </div> 
                            <div class="display_left_80">  
                                <asp:TextBox ID="TextBoxSkillOwnHeadingInsertDisplay" CssClass="si" MaxLength="150" onBlur="TBC(this,0)" onFocus="TBC(this,1)" Runat="Server" SkinID="TextBoxStandard" Text='<%# Bind("SkillOwnHeading")%>' Width="75%" /> 
                                <asp:Image ID="ImageRequiredSkillOwnHeadingInsert" BorderWidth="0" ImageUrl="~/Images/icon_required.gif" Runat="Server" /> 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidatorClientSideSkillOwnHeadingInsert" ControlToValidate="TextBoxSkillOwnHeadingInsertDisplay" Display="None" Enabled="false" ErrorMessage="<%$ Resources:SkillErrorMessageSkillOwnHeading.Text %>" Runat="Server" SetFocusOnError="true" /> 
                                <asp:CustomValidator ID="CustomValidatorServerSideSkillOwnHeadingInsertItemBlank" ControlToValidate="TextBoxSkillOwnHeadingInsertDisplay" Display="None" Enabled="false" ErrorMessage="<%$ Resources:SkillErrorMessageSkillOwnHeading.Text %>" OnServerValidate="CustomValidatorItemBlank_ServerValidate" Runat="Server" SetFocusOnError="true" ValidateEmptyText="True" /> 
                            </div> 
                        </div> 
                    </asp:Panel> 
                      
                    <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtenderSkillOwnHeadingInsert" runat="server" Collapsed="true" CollapsedSize="0" SuppressPostBack="true" TargetControlID="PanelSkillOwnHeadingInsertItem" /> 
                     



Matt
Top achievements
Rank 1
 answered on 11 Aug 2009
1 answer
141 views
This is probably a case of wood for trees, but I can't work out why this grid won't enter edit mode:

        <telerik:RadGrid ID="CompetitionRounds" runat="server" Enabled="False" AutoGenerateColumns="False" 
            DataSourceID="dsCompetitionRounds" GridLines="None" Width="400px" AllowAutomaticUpdates="True"> 
            <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true"> 
                <Selecting AllowRowSelect="true" /> 
            </ClientSettings> 
            <MasterTableView DataSourceID="dsCompetitionRounds" NoMasterRecordsText="No competition rounds" 
                DataKeyNames="RoundNumber" CommandItemDisplay="None" EditMode="PopUp" AllowAutomaticInserts="False" 
                AllowAutomaticUpdates="true" AllowAutomaticDeletes="false"> 
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <SortExpressions> 
                    <telerik:GridSortExpression FieldName="RoundNumber" SortOrder="Ascending" /> 
                </SortExpressions> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="CourseId" DataType="System.Guid" Display="False" 
                        EmptyDataText="" HeaderText="CourseId" SortExpression="CourseId" UniqueName="CourseId" 
                        Visible="False"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="RoundNumber" DataType="System.Byte" EmptyDataText="" 
                        HeaderText="#" HeaderTooltip="Round Number" ItemStyle-HorizontalAlign="Center" 
                        SortExpression="RoundNumber" UniqueName="RoundNumber"> 
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Width="10px" /> 
                        <ItemStyle HorizontalAlign="Center" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="RoundDate" DataFormatString="{0:dd/MM/yyyy HH:mm}" 
                        DataType="System.DateTime" EmptyDataText="" HeaderText="Date" HeaderTooltip="Round Date" 
                        SortExpression="RoundDate" UniqueName="RoundDate"> 
                        <HeaderStyle VerticalAlign="Top" Width="110px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Name" EmptyDataText="" HeaderText="Course" ReadOnly="True" 
                        SortExpression="Name" UniqueName="Name"> 
                        <HeaderStyle VerticalAlign="Top" Width="150px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="GentsStandardScratch" DataType="System.Byte" 
                        EmptyDataText="" HeaderText="GSI" HeaderTooltip="Gents Standard Scratch" ItemStyle-HorizontalAlign="Center" 
                        ReadOnly="True" SortExpression="GentsStandardScratch" UniqueName="GentsStandardScratch"> 
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Width="10px" /> 
                        <ItemStyle HorizontalAlign="Center" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="LadiesStandardScratch" DataType="System.Byte" 
                        EmptyDataText="" HeaderText="LSI" HeaderTooltip="Ladies Standard Scratch" ItemStyle-HorizontalAlign="Center" 
                        ReadOnly="True" SortExpression="LadiesStandardScratch" UniqueName="LadiesStandardScratch"> 
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Width="10px" /> 
                        <ItemStyle HorizontalAlign="Center" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="/Images/Cancel.gif" 
                        EditImageUrl="/Images/Edit.gif" UpdateImageUrl="/Images/Update.gif"> 
                        <HeaderStyle Width="10px" /> 
                    </telerik:GridEditCommandColumn> 
                </Columns> 
                <EditFormSettings EditFormType="Template"> 
                    <FormTemplate> 
                        <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" 
                            style="border-collapse: collapse; background: white;"> 
                            <tr> 
                                <td> 
                                    <table id="EditTable" cellspacing="1" cellpadding="1" width="250" border="0"> 
                                        <tr> 
                                            <td> 
                                                <img src="/Images/blank.gif" alt="" height="1px" width="70px" /> 
                                            </td> 
                                            <td> 
                                            </td> 
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                Round: 
                                            </td> 
                                            <td> 
                                                <telerik:RadNumericTextBox ID="numRoundNumber" DbValue='<%# Bind( "RoundNumber" ) %>' 
                                                    Enabled="true" ReadOnly="true" runat="server" NumberFormat-DecimalDigits="0" 
                                                    Width="40px" ShowSpinButtons="false" MinValue="1" MaxValue="72" /> 
                                            </td> 
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                Course: 
                                            </td> 
                                            <td> 
                                                <telerik:RadComboBox ID="lstCourseName" runat="server" DataSourceID="dsCourseNames" 
                                                    SelectedValue='<%# Bind("CourseId") %>' DataTextField="Name" DataValueField="Id" 
                                                    Width="130px"> 
                                                </telerik:RadComboBox> 
                                            </td> 
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                Date: 
                                            </td> 
                                            <td> 
                                                <telerik:RadDateTimePicker ID="dtmRoundDate" runat="server" DbSelectedDate='<%# Bind("RoundDate") %>' 
                                                    Skin="Default" Width="150px"> 
                                                    <TimePopupButton HoverImageUrl="" ImageUrl="" /> 
                                                    <TimeView ID="TimeView1" runat="server" StartTime="05:00" Interval="00:30" EndTime="21:00" 
                                                        CellSpacing="-1"> 
                                                    </TimeView> 
                                                    <Calendar ID="Calendar1" runat="server" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                                        ViewSelectorText="x"> 
                                                    </Calendar> 
                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" /> 
                                                </telerik:RadDateTimePicker> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </td> 
                                <td> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td align="right" colspan="2"> 
                                    <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> 
            </MasterTableView> 
        </telerik:RadGrid> 
 
 
    <asp:SqlDataSource ID="dsCompetitionRounds" runat="server" ConnectionString="<%$ ConnectionStrings:dbGolfHonoursConnectionString %>" 
        SelectCommand="leaderboard.lb_SelectCompetitionRound" SelectCommandType="StoredProcedure" 
        InsertCommand="leaderboard.lb_InsertCompetitionRound" InsertCommandType="StoredProcedure" 
        UpdateCommand="leaderboard.lb_UpdateCompetitionRound" UpdateCommandType="StoredProcedure" 
        DeleteCommand="leaderboard.lb_DeleteCompetitionRound" DeleteCommandType="StoredProcedure"> 
        <SelectParameters> 
            <asp:ControlParameter ControlID="Menu$lstCompetitionList" DbType="Guid" Name="CompetitionId" 
                PropertyName="SelectedValue" /> 
        </SelectParameters> 
        <InsertParameters> 
            <asp:ControlParameter ControlID="Menu$lstCompetitionList" DbType="Guid" Name="CompetitionId" 
                PropertyName="SelectedValue" /> 
            <asp:Parameter Name="CourseId" DbType="Guid" /> 
            <asp:Parameter Name="RoundNumber" Type="Int16" /> 
            <asp:Parameter Name="RoundDate" Type="DateTime" /> 
        </InsertParameters> 
        <UpdateParameters> 
            <asp:ControlParameter ControlID="Menu$lstCompetitionList" DbType="Guid" Name="CompetitionId" 
                PropertyName="SelectedValue" /> 
            <asp:Parameter Name="CourseId" DbType="Guid" /> 
            <asp:Parameter Name="RoundNumber" Type="Int16" /> 
            <asp:Parameter Name="RoundDate" Type="DateTime" /> 
        </UpdateParameters> 
        <DeleteParameters> 
            <asp:ControlParameter ControlID="Menu$lstCompetitionList" DbType="Guid" Name="CompetitionId" 
                PropertyName="SelectedValue" /> 
            <asp:Parameter Name="RoundNumber" Type="Int16" /> 
        </DeleteParameters> 
    </asp:SqlDataSource> 

Any ideas?
Missing User
 answered on 11 Aug 2009
2 answers
144 views
 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)  
             
        {  
           
                GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");  
                GridEditableItem item = (GridEditableItem)e.Item;  
                RadGrid Roles = (RadGrid)FindControlRecursive(this, "RadGrid2");  
                DataTable dtTable2 = new DataTable();  
                string conn2 = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();  
                SqlDataAdapter sqladp2 = new SqlDataAdapter();  
                SqlConnection sqlconn2 = new SqlConnection(conn2);  
                sqlconn2.Open();  
                try  
                {  
                    string selectQuery2 = "SELECT [RoleID], [Rolename] FROM [vw_UsersinRoles] WHERE [UserID] = " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["UserID"].ToString() + " ORDER BY [Username]";  
                    sqladp2.SelectCommand = new SqlCommand(selectQuery2, sqlconn2);  
                    sqladp2.Fill(dtTable2);  
                    Roles.DataSource = dtTable2;  
                    Roles.DataBind();  
                      
                }  
                finally  
                {  
                    sqlconn2.Close();  
                }  
        }   
    }  
 
    public Control FindControlRecursive(Control root, string id)  
    {  
        if (root.ID == id)  
        {  
            return root;  
        }  
 
        foreach (Control c in root.Controls)  
        {  
            Control t = FindControlRecursive(c, id);  
            if (t != null)  
            {  
                return t;  
            }  
        }  
 
        return null;  
    } 
   <form id="form1" runat="server">  
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
        AllowSorting="True" GridLines="None" Width="623px" AutoGenerateColumns="false" 
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
        GroupingSettings-CaseSensitive="false" PageSize="20" EnableLinqExpressions="False" 
        ShowStatusBar="True" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnItemCommand="RadGrid1_ItemCommand" 
        OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">  
        <MasterTableView ShowFooter="False" CommandItemSettings-AddNewRecordText="Add New Contact" 
            CommandItemDisplay="TopAndBottom" DataKeyNames="UserID">  
            <CommandItemSettings AddNewRecordText="Add New Form"></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" OnItemDataBound="RadGrid2_ItemDataBound" 
                                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AutoGenerateColumns="False" 
                                    GridLines="None">  
                                </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 CausesValidation="false" ID="btnEdit" Text="EditContact" 
                                    runat="server" CommandName="EditContact"></asp:Button> 
                                <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> 
Jon-Jon Kershaw
Top achievements
Rank 2
 answered on 11 Aug 2009
4 answers
216 views
Guys,
  I'm using Version 3.5 and the menu that we've built right now seems to work like a charm on IE 7/8, Safari but there seems to be a page break / mis-alignment when it comes to firefox. Am i overlooking something out here? Here's the screen shot in the respective browsers:

IE 8       : Site Link
Firefox  : Site Link
Safari    : Site Link

Regards,
Sandy Jain
Sandy Jain
Top achievements
Rank 1
 answered on 11 Aug 2009
1 answer
100 views
hi,

I've a radgrid with a gridbound col and a  grid template column in it.
The gridtemplate column has a dropdownlist control in it.

The whole grid is an user ctrl . I've a wizard kind of page where i clcik back and next to go to further pages.

I select values in the dropdownlist (which is a 2nd step in the wizard) and when i click back, it goes to the first step and then clciking next from there, it comes to my gridtemplate page but now i don't have any of my selected values in the dropdownlist. they all point to the first value. how do i make them retain the selected value even if i travel across wizrds.

I've even done this in grid's databound event:
ddl.selectedindex =  e.item.selctedindex;(where ddl is the dropdownlist in the gridtemplate col).
but it does not work. pls do help me with code.
Thanks,
ZR
Mira
Telerik team
 answered on 11 Aug 2009
4 answers
440 views
Hi,

I am having hard time getting value of RadComboBoxes in RadGrid. Here is the Javascript that I tried to write. I also don't know how to get the index of the row.
Thanks for help.

 

function Validate(sender, args)

 

{

 

var DataItems = $find("<%=RadGrid3.ClientID %>").get_masterTableView().get_dataItems();

 

 

var index =??????????????????????

 

 

var cb1 = $telerik.findControl(DataItems[index].get_element(), "RadComboBox1");

 

 

var cb2 = $telerik.findControl(DataItems[index].get_element(), "RadComboBox2");

 

}

Tsvetoslav
Telerik team
 answered on 11 Aug 2009
3 answers
101 views
Hi,

I've created a RAD Grid user control using RAD Controls Q2 2009 release version with java scripts code on client-side. Then i just embed the user control in an aspx page which additionally holds ajax components. 

But while executing, the scripts on the user control were unavailable (throwing object not found error) during run-time. But the web page level scripts are available. 

Do i need to specify some properties to make the user control scripts available in the web page?

Please let me know.

Thanks
Pavlina
Telerik team
 answered on 11 Aug 2009
2 answers
604 views

When the grid runs in a german version of IE on a german version of the operating system, date columns show their dates using periods separating the day, month and year. What I really want is the format to be whatever I set it to be on the server using whatever regional setting applies to the user. The regional setting is independent of the browser's language or the language of the operating system. It is a web application setting specific for the user. Here is my code example:

DateTimeFormatInfo dateTimeFormat = new CultureInfo("en-us", false).DateTimeFormat;  
GridDateTimeColumn colSessionStartTime = this.RadGridSkillsData.Columns.FindByUniqueName("SessionStartTimeLocal") as GridDateTimeColumn;  
colSessionStartTime.DataFormatString = "{0:" + dateTimeFormat.ShortDatePattern + " " + dateTimeFormat.LongTimePattern + "}"; 

When I view what colSessionStartTime.DataFormatString is set to, it shows up as:

"{0:M/d/yyyy h:mm:ss tt}"

Yet the values that appear in the grid are showing periods rather than slashes for the date.

How can I get the date to format according to any culture code?

Johann

Daniel
Telerik team
 answered on 11 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?