Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
162 views
Hi all,

I have a nestedview on a rad grid. I am trying to follow the examples provided but I cannot make it work properly. In the onItemCommand event I am binding a formview which is in the nestedview. When I expand the first row, I can see everything properly, however all rows after that show nothing. I have made sure that I am properly binding the formview and that the datasource has valid data.

Please review the code and help.

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            try 
            {  
                RadGrid1.DataSource = myWorkorderController.getAllWorkorders("Closed");  
            }  
            catch (Exception ex)  
            {  
                throw ex;  
            }  
        }  
 
        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
        {  
            if (e.CommandName == RadGrid.ExpandCollapseCommandName)  
            {  
                if (!e.Item.Expanded)  
                {  
                    FormView oFormView = (FormView)RadGrid1.MasterTableView.Items[0].ChildItem.FindControl("FormView1");  
                    ACareFlangeWOHistoryByWOID_inType oWOHistInfo = new ACareFlangeWOHistoryByWOID_inType();  
                    oWOHistInfo.WOID = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["WONUM"].Text;  
                    oFormView.DataSource = myWorkorderController.getAllWorkorderHistory(oWOHistInfo);  
                    oFormView.DataBind();  
                    ((GridDataItem)e.Item).ChildItem.FindControl("NestedViewPanel").Visible =  
                   !e.Item.Expanded;  
                }  
            }  
        }  
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                RadGrid1.MasterTableView.Items[0].Expanded = true;  
                RadGrid1.MasterTableView.Items[0].ChildItem.FindControl("NestedViewPanel").Visible = true;  
            }  
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridNestedViewItem)  
            {  
                //e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).Parent.Expanded;  
            }  
        } 


<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"   
        OnItemCommand="RadGrid1_ItemCommand" AutoGenerateColumns="False" GridLines="None" Skin="Outlook" 
        AlternatingItemStyle-BackColor="#D9E6F2" ShowFooter="True" AllowFilteringByColumn="True" AllowPaging="True"   
        AllowSorting="True" OnPreRender="RadGrid1_PreRender">  
    <HeaderContextMenu EnableTheming="True" Skin="Outlook">  
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </HeaderContextMenu> 
    <AlternatingItemStyle BackColor="#D9E6F2" /> 
    <MasterTableView Name="Workorders" PageSize="20" DataKeyNames="WONUM">  
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px" /> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px" /> 
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="CMWOID" Display="False" HeaderText="CMWOID"   
                UniqueName="CMWOID" ReadOnly="true">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="WONUM" HeaderText="WO #"   
                UniqueName="WONUM">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="EquipID" HeaderText="Equipment ID"   
                UniqueName="EquipID" ReadOnly="true" Display="false">  
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn HeaderText="Equip ID" DataField="EquipID" SortExpression="EquipID">  
                <ItemTemplate> 
                    <asp:Label runat="server" ID="lblEquipID" Text='<% #Eval("EquipID") + "&nbsp;" %>'>  
                    </asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <telerik:RadComboBox ID="ddlEquipID" runat="server" DataTextField="equipids" 
                        DataValueField="equipids" Skin="Outlook">  
                    </telerik:RadComboBox> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn DataField="EquipGroup"   
                HeaderText="Equip Group" UniqueName="EquipGroup">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="ProdUnit" HeaderText="Prod Unit"   
                UniqueName="ProdUnit">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="ProcessUnit" HeaderText="Process Unit"   
                UniqueName="ProcessUnit">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="EquipLocID" HeaderText="EquipLocID"   
                UniqueName="EquipLocID" ReadOnly="true" Display="false">  
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn HeaderText="Location" DataField="EquipLocID" SortExpression="EquipLocID">  
                <ItemTemplate> 
                    <asp:Label runat="server" ID="lblEquipLocID" Text='<% #Eval("EquipLocID") + "&nbsp;" %>'>  
                    </asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <telerik:RadComboBox ID="ddlEquipLocID" runat="server" DataTextField="Description" 
                        DataValueField="LocationID" Skin="Outlook">  
                    </telerik:RadComboBox> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn DataField="JobType" HeaderText="Job Type"   
                UniqueName="JobType" ReadOnly="true" Display="false">  
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn HeaderText="Job Type" DataField="JobType" SortExpression="JobType">  
                <ItemTemplate> 
                    <asp:Label runat="server" ID="lblJobTypeID" Text='<% #Eval("JobType") + "&nbsp;" %>'>  
                    </asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <telerik:RadComboBox ID="ddlJobType" runat="server" DataTextField="Type" 
                        DataValueField="Type" Skin="Outlook">  
                    </telerik:RadComboBox> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn DataField="Plant" HeaderText="Plant"   
                UniqueName="Plant">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Priority" HeaderText="Priority"   
                UniqueName="Priority">  
            </telerik:GridBoundColumn> 
            <telerik:GridDateTimeColumn DataField="RequestDate" HeaderText="Request Date"   
                UniqueName="RequestDate">  
            </telerik:GridDateTimeColumn> 
            <telerik:GridBoundColumn DataField="AssignedTo" HeaderText="Assigned To"   
                UniqueName="AssignedTo" ReadOnly="true" Display="false">  
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn HeaderText="Assigned To" DataField="AssignedTo" SortExpression="AssignedTo">  
                <ItemTemplate> 
                    <asp:Label runat="server" ID="lblAssignedToID" Text='<% #Eval("AssignedTo") + "&nbsp;" %>'>  
                    </asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <telerik:RadComboBox ID="ddlAssignedTo" runat="server" DataTextField="UserName" 
                        DataValueField="UserID" Skin="Outlook">  
                    </telerik:RadComboBox> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn DataField="ProbDescription" HeaderText="Prob Desc"   
                UniqueName="ProbDescription">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Service" HeaderText="Service"   
                UniqueName="Service">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Reason" HeaderText="Reason"   
                UniqueName="Reason">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="SVCCode" HeaderText="SVCCode"   
                UniqueName="SVCCode">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="ReasonCode" HeaderText="ReasonCode"   
                UniqueName="ReasonCode">  
            </telerik:GridBoundColumn> 
        </Columns> 
        <NestedViewTemplate> 
            <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap" Visible="false">  
            <asp:FormView ID="FormView1" runat="server">  
                <ItemTemplate> 
                <div class="contactWrap">  
                    <fieldset style="padding: 10px;">  
                        <legend style="padding: 5px;"><b>Execution Date:&nbsp; &nbsp;<%#Eval("ExecDate") %></b>  
                        </legend> 
                        <table> 
                            <tbody> 
                                <tr> 
                                    <td> 
                                        <fieldset style="padding: 10px;">  
                                        <legend style="padding: 5px;"><b>Repair Maintenance</b> 
                                        </legend> 
                                        <table> 
                                            <tbody> 
                                                <tr> 
                                                    <td> Cause Description: </td> 
                                                    <td> 
                                                        <asp:Label ID="cityLabel" Text='<%#Bind("CauseDesc") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> Failure Reason: </td> 
                                                    <td> 
                                                        <asp:Label ID="Label2" Text='<%#Bind("FailReason") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Order Problem:</td> 
                                                    <td> 
                                                        <asp:Label ID="Label3" Text='<%#Bind("OrderProblem") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Parts Replaced:</td> 
                                                    <td> 
                                                        <asp:Label ID="Label4" Text='<%#Bind("PartsReplaced") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Replace Reason:</td> 
                                                    <td> 
                                                        <asp:Label ID="Label5" Text='<%#Bind("ReplaceReason") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Recommendation:</td> 
                                                    <td> 
                                                        <asp:Label ID="Label6" Text='<%#Bind("Recommendation") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Task Sequence:</td> 
                                                    <td style="width:230px">  
                                                        <asp:Label ID="Label7" Text='<%#Bind("TaskSeq") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Sec 2 Date:</td> 
                                                    <td> 
                                                        <asp:Label ID="Label8" Text='<%#Bind("Sec2Date") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Sec 2 Name:</td> 
                                                    <td> 
                                                        <asp:Label ID="Label9" Text='<%#Bind("Sec2Name") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                            </tbody> 
                                        </table> 
                                    </td> 
                                    <td> 
                                        <fieldset style="padding: 10px;">  
                                        <legend style="padding: 5px;"><b>Preventive Maintenance</b> 
                                        </legend> 
                                        <table> 
                                            <tbody> 
                                                <tr> 
                                                    <td> Last Calibiration: </td> 
                                                    <td> 
                                                        <asp:Label ID="Label10" Text='<%#Bind("LastCalib") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> Torque Value Used: </td> 
                                                    <td> 
                                                        <asp:Label ID="Label11" Text='<%#Bind("TorquevalUsed") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label30" runat="server" Text='<% #Bind("Chk1Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label12" Text='<%#Bind("Chk1") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label13" runat="server" Text='<% #Bind("Chk2Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label19" Text='<%#Bind("Chk2") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label14" runat="server" Text='<% #Bind("Chk3Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label20" Text='<%#Bind("Chk3") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label15" runat="server" Text='<% #Bind("Chk4Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label21" Text='<%#Bind("Chk4") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label16" runat="server" Text='<% #Bind("Chk5Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label22" Text='<%#Bind("Chk5") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label17" runat="server" Text='<% #Bind("Chk6Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label23" Text='<%#Bind("Chk6") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label18" runat="server" Text='<% #Bind("Chk7Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label24" Text='<%#Bind("Chk7") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label25" runat="server" Text='<% #Bind("Chk8Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label26" Text='<%#Bind("Chk8") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label27" runat="server" Text='<% #Bind("OPT1Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label28" Text='<%#Bind("OPT1") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <asp:Label ID="Label29" runat="server" Text='<% #Bind("OPT2Name")%>'></asp:Label> 
                                                    </td> 
                                                    <td> 
                                                        <asp:Label ID="Label31" Text='<%#Bind("OPT2") %>' runat="server"></asp:Label> 
                                                    </td> 
                                                </tr> 
                                            </tbody> 
                                        </table> 
                                    </td> 
                                </tr> 
                            </tbody> 
                        </table> 
                    </fieldset> 
                </div> 
                </ItemTemplate> 
            </asp:FormView> 
            </asp:Panel> 
        </NestedViewTemplate> 
    </MasterTableView> 
    <FilterMenu EnableTheming="True" Skin="Outlook">  
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </FilterMenu> 
</telerik:RadGrid> 

Please help.
Ali Kitabi
Top achievements
Rank 1
 answered on 01 Oct 2009
1 answer
83 views

 Hello All

I have a problem where a rad chart displays one bar only when the underlying data source returns data for multiple bars. Any idea why only the first bar is showing?

Please help asap.

Thanks

Schlurk
Top achievements
Rank 2
 answered on 01 Oct 2009
6 answers
183 views
I have dragged the RadSlider control to my web-page. The radslider works fine but it is fixed on the page and does not scroll with the page. This slider is inside Table and the webpage uses master file. Even when it is outside the table it does not scroll. This would be fine if I don't have page long enough to scroll. Looks like I am missing one of the properties. Any help would be appreciated. In demos it seem to scroll along with page. How is this done?

<telerik:RadSlider ID="rsMEDUpdateMedRecord" runat="server" AnimationDuration="400" 
                            Height="42px" ItemType="Tick" LargeChange="1" MaximumValue="5" 
                            TrackPosition="TopLeft" Width="350px" ClickOffset="1" Length="350"   
                            Skin="Vista">  
                        </telerik:RadSlider>   
Tsvetie
Telerik team
 answered on 01 Oct 2009
1 answer
55 views
Dear All,

Is there a simple way of filtering the GridBoundColumn over a diferent field than the one defined in the DataField property. I am passing quite complex HTML to the DataField which in the end is being rendered to the user as a simple text with some extra functionality. I would like to be able to filter against this text value instead agains the complex HTML. I imagine the GetFilterDataField() of the GridBoundColumn does just that? I was trying to override the GridBoundColumn but then I receive the "Cannot create column with the specified type name" error.

Regards,
Adam
Pavlina
Telerik team
 answered on 01 Oct 2009
6 answers
355 views
I have tried for days trying to do what seems would be simple but I cannot seem to get an image to hide in a column based on another columns value. Here is what I am trying to do.

  • I have a template column with the uniquename of "noteimgcolumn" inside this column I have a image "Bullet.gif"
  • I have another hidden column with the uniquename "Notes" which has user notes about this record which a user will update from time to time.
  • I have a Radtooltip assigned to the bullet.gif inside the template column which shows the notes for this particular record on mouseover.
  • I would like to hide the bullet.gif if the length of the note columns value is less than 10 "this is because on some imports from a spreadsheet will actually put in "NULL" into the notes field. I also need to hide the image if the note field is truly null.

I have tried every sample app you have supplied on the forums and still cannot get this to work It always shows the image. Below is the code for the page I do not have any code behind since none of what I tried was working.

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
                AllowSorting="True" 
                DataSourceID="SqlDataSource1" GridLines="None" ShowGroupPanel="True" 
                Skin="Office2007" AllowAutomaticInserts="True" AllowAutomaticDeletes="True"  AllowAutomaticUpdates="True" HorizontalAlign="Left" Width="100%">  
<ItemStyle HorizontalAlign="Center" /> 
 
<PagerStyle Position="TopAndBottom" Mode="NumericPages" /> 
 
<MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" ForeColor="Black" DataKeyNames="ContactID" CommandItemDisplay="Top" AllowPaging="True" editmode="PopUp" showfooter="True">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
<Columns> 
<telerik:GridEditCommandColumn HeaderImageUrl="./images/icon_edit_topic.gif" Resizable="False"></telerik:GridEditCommandColumn> 
<telerik:GridButtonColumn ConfirmTitle="Delete Confirmation" ConfirmDialogType="RadWindow" CommandName="Delete" Text="Delete" ImageUrl="/images/delete.gif" ConfirmText="Are you sure you want to delete record?" HeaderImageUrl="./images/delete.gif" HeaderText="Delete" Reorderable="False" UniqueName="column1"></telerik:GridButtonColumn> 
<telerik:GridTemplateColumn AllowFiltering="False" HeaderText="Notes" UniqueName="noteimgcolumn"><ItemTemplate> 
<ITEMTEMPLATE /><asp:Image id="Image1" runat="server" __designer:wfdid="w301" ImageUrl="~/images/bullet.gif"</asp:Image> &nbsp;<telerik:RadToolTip id="RadToolTip1" title="Contact Notes" runat="server" Skin="Office2007" Width="693px" Height="75px" sPosition="BottomLeft" __designer:wfdid="w302" TargetControlID="image1" RelativeTo="Element" Position="BottomRight" EnableTheming="False" AutoCloseDelay="5000" Animation="Resize" ShowDelay="100"><BR /><DIV style="BACKGROUND-IMAGE: url(Images/bg-fade.gif); WIDTH: 686px; HEIGHT: 141px; BACKGROUND-COLOR: yellow" align=left><asp:Label id="Label4" runat="server" Text='<%# Eval("FirstName") %>' __designer:wfdid="w303" Font-Size="Large" ForeColor="Red"></asp:Label> <asp:Label id="Label5" runat="server" __designer:wfdid="w304"></asp:Label> <asp:Label id="Label6" runat="server" Text='<%# Eval("LastName") %>' __designer:wfdid="w305" Font-Size="Large" ForeColor="Red"></asp:Label><BR /> 
<HR /> 
<asp:Label id="Label3" runat="server" Text="Note:" __designer:wfdid="w299" Font-Size="Medium" ForeColor="Maroon"></asp:Label><BR /><asp:Label id="Label7" runat="server" Text='<%# Eval("Notes") %>' Font-Bold="False" __designer:wfdid="w300" Font-Size="Medium" ForeColor="Blue" EnableTheming="True"></asp:Label><BR /><BR /><BR /><BR /><BR /><BR /><BR /></DIV></telerik:RadToolTip>   
</ItemTemplate> 
</telerik:GridTemplateColumn> 
<telerik:GridBoundColumn DataField="lastname" HeaderText="Last Name" UniqueName="column3"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="column2"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="middlename" HeaderText="Middle Name" Visible="False" UniqueName="column4"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="suffix" HeaderText="Suffix" Visible="False" UniqueName="column6"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title" Visible="False" UniqueName="Title"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="JobTitle" HeaderText="JobTitle" SortExpression="JobTitle" Visible="False" UniqueName="JobTitle"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Company" HeaderText="Company" SortExpression="Company" UniqueName="Company"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Address" HeaderText="Address" UniqueName="column7"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="WorkFax" HeaderText="WorkFax" SortExpression="WorkFax" UniqueName="WorkFax"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="WorkPhone" HeaderText="WorkPhone" SortExpression="WorkPhone" UniqueName="WorkPhone"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="WorkPhoneExtension" HeaderText="WorkPhoneExtension" SortExpression="WorkPhoneExtension" Visible="False" UniqueName="WorkPhoneExtension"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Address1" HeaderText="Address1" SortExpression="Address1" Visible="False" UniqueName="Address1"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Address2" HeaderText="Address2" SortExpression="Address2" Visible="False" UniqueName="Address2"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="City" HeaderText="City" SortExpression="City" Visible="False" UniqueName="City"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="State" HeaderText="State" SortExpression="State" Visible="False" UniqueName="State"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="ZipCode" HeaderText="ZipCode" SortExpression="ZipCode" Visible="False" UniqueName="ZipCode"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Country" HeaderText="Country" SortExpression="Country" Visible="False" UniqueName="Country"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="EmailAddress" HeaderText="EmailAddress" SortExpression="EmailAddress" Visible="False" UniqueName="EmailAddress"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="ContactID" ReadOnly="True" Visible="False" UniqueName="column5"></telerik:GridBoundColumn> 
<telerik:GridBoundColumn DataField="Notes" MaxLength="1000" HeaderText="Note" Visible="False" UniqueName="column"></telerik:GridBoundColumn> 
</Columns> 
 
<EditFormSettings> 
<EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
</EditFormSettings> 
 
<ItemStyle HorizontalAlign="Left" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></ItemStyle> 
 
<GroupHeaderItemStyle HorizontalAlign="Left" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></GroupHeaderItemStyle> 
 
<AlternatingItemStyle HorizontalAlign="Left" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></AlternatingItemStyle> 
 
<EditItemStyle HorizontalAlign="Left" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></EditItemStyle> 
 
<PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="20" Position="TopAndBottom" HorizontalAlign="Left" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></PagerStyle> 
 
<HeaderStyle HorizontalAlign="Center" Wrap="True" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"></HeaderStyle> 
</MasterTableView> 
 
<ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">  
<Selecting AllowRowSelect="True"></Selecting> 
</ClientSettings> 
 
<FilterMenu EnableTheming="True" Skin="Hay">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
 
<EditItemStyle BackColor="White" HorizontalAlign="Left" /> 
 
<FilterItemStyle HorizontalAlign="Center" /> 
</telerik:RadGrid> 
Thanks in advance.
Robert
Top achievements
Rank 1
 answered on 01 Oct 2009
6 answers
318 views
My goal is to have the textboxes border change from "none" to "solid" or back again based on onclick of an associated checkbox.
The problem is that the border is not changing, or not staying set depending on how I do it.
I'll start with the javascript because that is probably the source of the problem:
 
function onCheckboxChanged(CheckboxField, ComputedValueField, ActualValueField) { 
    //Checkbox has been checked 
    var ActualField = document.getElementById(ActualValueField); 
    alert(ActualField.id); 
    if (document.getElementById(CheckboxField).checked == true) { 
        var ComputedVal = document.getElementById(ComputedValueField).value; 
        ActualField.value = ComputedVal; 
        ActualField.readOnly = false
        ActualField.style.border = "medium solid"
    } 
    else { 
        ActualField.value = "0"
        ActualField.readOnly = true
        ActualField.style.border = "none"
    } 
    //alert(ActualField.style.border); 
    CalculateActualTotals(); 
There are no exceptions thrown, and the radnumericTextbox does turn readOnly or not readOnly based on the checkbox, but I can't see the border change. When I did an alert on the ActualField.style.border it did say "medium solid -moz-use-text-color" (obviously I am testing Firefox, but it also has to work for IE 7+).
After looking at the rendered source I decided to try:
var ActualField = document.getElementById(ActualValueField + "_text"); 
which did show the border, but only until I moused over it (I have no other events set other than what I've mentioned here), so that doesn't really seem like a solution.
For reference here is one line of my table, they are all the same just with different names.
<tr> 
    <td> 
        <asp:CheckBox ID="chkCM" runat="server" onclick="onCheckboxChanged('chkCM','radnumComputedCM','radnumActualCM')"/> 
    </td> 
    <td> 
        <asp:TextBox ID="txtAccNameCM" runat="server" BorderStyle="None" ReadOnly="true"/> 
    </td> 
    <td> 
        <telerik:RadNumericTextBox ID="radnumComputedCM" runat="server" BorderStyle="None" ReadOnly="true" MaxValue="9999.99" 
             EmptyMessage="$" NumberFormat-DecimalDigits="2" MinValue="0" CssClass="copysmall" Width="60px"
            <NumberFormat DecimalDigits="2" PositivePattern="$n" /> 
        </telerik:RadNumericTextBox> 
    </td> 
    <td> 
        <telerik:RadNumericTextBox ID="radnumActualCM" runat="server" BorderStyle="None" ReadOnly="true" MaxValue="9999.99"  
             EmptyMessage="$" NumberFormat-DecimalDigits="2" MinValue="0" CssClass="copysmall" Width="60px"
            <NumberFormat DecimalDigits="2" PositivePattern="$n" /> 
        </telerik:RadNumericTextBox> 
    </td> 
</tr> 

.
Gary B.
Top achievements
Rank 1
 answered on 01 Oct 2009
1 answer
475 views
Hi,

We are having a tabstrip and radmultipageview with each tab being a usercontrol.Everything works fine when we load all the usercontrols on the page load of the parent page.

Since its taking too long time to load all the user controls we need to load the user control on tab click.But when we do this the first time on tab click the control appears,but on subsequent request(Like clicking a dropdown on the user control) doesnot show the user control.it just displays a blank page.

Any idea how we can load these user controls dynamically on tab click. We also tried the below link and it doesn't seem to be working.
http://www.telerik.com/support/kb/aspnet-ajax/tabstrip/loading-user-controls-dynamically-on-tabclick-and-postback-from-loaded-user-control.aspx

Each user control has its own RadajaxPanel

Please see below our code snippet

Parent page ASPX
--------------------------------

<

 

asp:Panel ID="pnlTab" runat="server" Width="100%" >

 

 

<telerik:RadTabStrip ID="tabStrpInstrFiles" runat="server" MultiPageID="radMultiPageInstrFileVwr"

 

 

SelectedIndex="0" >

 

 

<Tabs>

 

 

<telerik:RadTab runat="server" Text="Summary" PageViewID="radPageViewSummary" Selected="true">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Comments" PageViewID="radPageViewComments">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Market" PageViewID="radPageViewMarkets">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Consolidation" PageViewID="radPageViewMarketsCons">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Product" PageViewID="radPageViewProducts" >

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Facts" PageViewID="radPageViewFacts">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab runat="server" Text="Period" PageViewID="radPageViewPeriods">

 

 

</telerik:RadTab>

 

<%

--<telerik:RadTab runat="server" Text="Comments" PageViewID="radPageViewComments">

 

</telerik:RadTab--

 

%>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

 

<telerik:RadMultiPage ID="radMultiPageInstrFileVwr" runat="server" Width="100%"

 

 

SelectedIndex="0">

 

 

<telerik:RadPageView ID="radPageViewSummary" runat="server" Selected="True"></telerik:RadPageView>

 

 

<telerik:RadPageView ID="radPageViewComments" runat="server"></telerik:RadPageView>

 

 

<telerik:RadPageView ID="radPageViewMarkets" runat="server"></telerik:RadPageView>

 

 

<telerik:RadPageView ID="radPageViewMarketsCons" runat="server" ></telerik:RadPageView>

 

 

<telerik:RadPageView ID="radPageViewProducts" runat="server" ></telerik:RadPageView>

 

 

<telerik:RadPageView ID="radPageViewFacts" runat="server"></telerik:RadPageView>

 

 

<telerik:RadPageView ID="radPageViewPeriods" runat="server"></telerik:RadPageView>

 

<%

--<telerik:RadPageView ID="radPageViewComments" runat="server"></telerik:RadPageView>--%>

 

 

</telerik:RadMultiPage>

 

 

</asp:Panel>

CodeBehind File
--------------------------------------

 

protected

 

void Page_Load(object sender, EventArgs e)

 

{

 

if (!this.IsPostBack)

 

{

 

this._presenter.OnViewInitialized();

 

Master.ShowBanner =

false;

 

 

 

if (HttpContext.Current.Session["INSTR_PROJECT_NAME"] != null)

 

{

dbName = (

string)HttpContext.Current.Session["INSTR_PROJECT_NAME"];

 

}

 

if (HttpContext.Current.Session["INSTR_PROJECT_Type_NAME"] != null)

 

{

dbTypeName = (

string)HttpContext.Current.Session["INSTR_PROJECT_Type_NAME"];

 

}

 

this.lblDatabaseName.Text = this.lblDatabaseName.Text + " " + dbTypeName + " - " + dbName;

 

}

 

if (HttpContext.Current.Session["INSTR_ID"] != null)

 

{

dbId = (

int)HttpContext.Current.Session["INSTR_ID"];

 

}

 

//Set the Pageview for Summary

 

 

 

 

radMultiPageInstrFileVwr.PageViews[0].Controls.Add(LoadControl(

"~/Instr/InstrSummaryControl.ascx"));

 

 

//Set the Pageview for Comments

 

 

 

 

radMultiPageInstrFileVwr.PageViews[1].Controls.Add(LoadControl(

"~/Instr/InstrCommentControl.ascx"));

 

 

//Set the Pageview for Market

 

 

 

 

radMultiPageInstrFileVwr.PageViews[2].Controls.Add(LoadControl(

"~/Instr/InstrMarketControl.ascx"));

 

 

//Check if Market or Index Consolidation Exists

 

 

 

 

 

int consolidationCount=this._presenter.CheckConsolidationExists(dbId);

 

 

if (consolidationCount==0)

 

{

 

//Hide the Consolidation tab

 

 

 

 

tabStrpInstrFiles.Tabs[3].Enabled =

false;

 

}

 

else

 

 

 

 

{

tabStrpInstrFiles.Tabs[3].Enabled =

true;

 

radMultiPageInstrFileVwr.PageViews[3].Controls.Add(LoadControl(

"~/Instr/InstrConsolidationControl.ascx"));

 

}

 

//Set the Pageview for Consolidation

 

 

 

 

radMultiPageInstrFileVwr.PageViews[4].Controls.Add(LoadControl(

"~/Instr/InstrProductControl.ascx"));

 

 

//Set the Pageview for Fact

 

 

 

 

radMultiPageInstrFileVwr.PageViews[5].Controls.Add(LoadControl(

"~/Instr/InstrFactControl.ascx"));

 

 

//Set the Pageview for Period

 

 

 

 

radMultiPageInstrFileVwr.PageViews[6].Controls.Add(LoadControl(

"~/Instr/InstrPeriodControl.ascx"));

 

 

//Set the Pageview for Comments

 

 

 

 

 

//radMultiPageInstrFileVwr.PageViews[6].Controls.Add(LoadControl("~/Instr/InstrCommentControl.ascx"));

 

 

 

 

 

if (Convert.ToInt32(Request.QueryString["Tab"]) == ApplicationConstants.PRODUCT_TAB)

 

{

tabStrpInstrFiles.SelectedIndex = 4;

radPageViewProducts.Selected =

true;

 

}

 

this._presenter.OnViewLoaded();

 

 

this.Master.CheckSessionTimeout();

 

}

Thanks and Regards
V.Balamurali

Paul
Telerik team
 answered on 01 Oct 2009
1 answer
88 views
Hi,

          How could i minimize the height of the combo box....since its default is showing 22px. but i want much more smaller. What i have to do in this situation.

            I have added my code with this..... pl check....


       <telerik:RadComboBox ShowToggleImage="false" ShowDropDownOnTextboxClick="false"
                ID="RadAjaxCombo" runat="server" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                ItemRequestTimeout="500" OnItemsRequested="RadAjaxCombo_ItemsRequested"
                onselectedindexchanged="RadAjaxCombo_SelectedIndexChanged1" Width="160px">
            </telerik:RadComboBox>

Regards,
Vijayaragavan R
Kamen Bundev
Telerik team
 answered on 01 Oct 2009
3 answers
144 views
Hi,
I have create a radwindow using the following code
<radw:radwindowmanager id="RadWindowManager1" LicenseFile="~/RadControls/LicenseFile.xml" runat="server">
    <Windows>
        <radw:RadWindow runat="server" NavigateUrl="CandidateReportAdvancedOptions.aspx" ReloadOnShow="true" ID="RadWindow3" SkinsPath="~/RadControls/Window/Skins" Top="" Left="" Title="Candidate Report Advanced Options" Height="270px" Width="400px" Modal="True" VisibleStatusbar="False" Behavior="Close" />
</Windows>
</radw:radwindowmanager>

and opening the window from a javascript function on clicking a link button.

the rad window works fine with IE and firefox but in SAFARI the window is not opening in  the first time click instead it opens when we click the link for the second time.

which property is to be used or which code is needed to be added to display the rad window in the first time click of a link.

Thanks in advance

 

Georgi Tunev
Telerik team
 answered on 01 Oct 2009
2 answers
146 views
Hello!

I have problem with RadGrid.
The site (and codebehind) code is at the bottom.

I bind records to RadGrid - I have paging enabled. I go to the 2nd page. Then I write some string in filter textbox and choose "StartsWith".
Everything is okay - I have correct records. Now I want to change filter string, but the context menu doesn't show up.

I don't know what's going on.


Site:

<style type="text/css"
  .item, .alternatingItem 
   float: left; 
   padding: 15px; 
   margin: 15px; 
   width: 250px; 
   height: 100px; 
   border: 1px solid threedshadow; 
   line-height:20px; 
.item 
   background: whitesmoke !important; 
.alternatingItem 
   background: window !important; 
.av{float:left; margin-right:10px; margin-top:5px;} 
.rank{margin-top:5px;} 
      .loading 
        { 
            background-color: #fff; 
            height:100%; 
            width:100%; 
        } 
        .loader  
        { 
            margin:auto; 
        } 
</style> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="cph1" Runat="Server"
<h2 class="title">Nasza spoÅ‚eczność</h2> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RG1"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RG1" LoadingPanelID="RALP1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
 
    <asp:Panel ID="P1" runat="server"
        <telerik:RadGrid ID="RG1" DataSourceID="GetRankingUsers" AllowFilteringByColumn="true" 
           runat="server" GridLines="None" AllowPaging="true" AllowSorting="true" 
           PageSize="9" Skin="WebBlue" AutoGenerateColumns="False"
           <PagerStyle Mode="NextPrevAndNumeric" FirstPageToolTip="Pierwsza strona" HorizontalAlign="Center"  
                LastPageToolTip="Ostatnia strona" NextPagesToolTip="NastÄ™pne strony"  
                NextPageToolTip="NastÄ™pna strona" PageSizeLabelText="Wyników na stronÄ™:" 
                PrevPagesToolTip="Poprzednie strony" PrevPageToolTip="Poprzednia strona" PagerTextFormat="{4} Strona {0} z {1} ({5} rekordów)" /> 
           <MasterTableView TableLayout="Fixed"
           <Columns> 
            <telerik:GridBoundColumn DataField="user_id" HeaderText="#ID" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false"
            </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="UserName" HeaderText="Gracz" AutoPostBackOnFilter="true"
            </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="game_id" HeaderText="#ID w grze" AutoPostBackOnFilter="true"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="game_name" HeaderText="Nick w grze"
            </telerik:GridBoundColumn>  
            <telerik:GridDateTimeColumn FilterControlWidth="100px" DataField="forum_date_join" HeaderText="DołączyÅ‚" SortExpression="forum_date_join" 
                        UniqueName="forum_date_join" PickerType="DatePicker" DataFormatString="{0:D}" AllowFiltering="false"></telerik:GridDateTimeColumn> 
             <telerik:GridBoundColumn DataField="forum_total_points" HeaderText="Ranking" AllowFiltering="false" AllowSorting="true"
            </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="avatar" HeaderText="Użytkownik" Visible="false" AllowFiltering="false" AllowSorting="false"
            </telerik:GridBoundColumn> 
           </Columns> 
               <ItemTemplate> 
                   <%#IIf(Not CType(Container, GridItem).ItemIndex = 0, "</td></tr></table>", "")%> 
                   <asp:Panel ID="ItemContainer" CssClass='<%# IIf(CType(Container, GridItem).ItemType = GridItemType.Item, "item", "alternatingItem") %>' 
                        runat="server"
                        <img src='<%#forum_engine.AvatarUrl(Eval("avatar"))%>' class="border av" alt='<%#Eval("UserName") %>'/> 
                        <b><a href='<%# "http://www.erepublik.com.pl/profil/u-" & Eval("user_id") %>' target="_blank"><%# Eval("UserName")%></a></b> 
                        <br /> 
                        DołączyÅ‚: <%#Convert.ToDateTime(Eval("forum_date_join")).ToString("dd MMMM yyyy")%> 
                        <br /> 
                        Znany jako: <b><a href='<%# "http://www.erepublik.com/en/citizen/profile/" & Eval("game_id") %>' target="_blank"><%#Eval("game_name")%></a></b><br /> 
                        <img src='<%# ResolveUrl(forum_engine.ReturnPoints(Eval("forum_total_points"),Eval("game_id"))) %>' class="rank" title='<%#Eval("forum_total_points") & " pkt"%>' /> 
                   </asp:Panel> 
               </ItemTemplate> 
           </MasterTableView> 
            <SortingSettings SortedAscToolTip="Sortuj rosnÄ…co"  
                SortedDescToolTip="Sortuj malejÄ…co" SortToolTip="Sortuj" /> 
       </telerik:RadGrid> 
        </asp:Panel> 
               <telerik:RadAjaxLoadingPanel ID="RALP1" runat="server" EnableSkinTransparency="true" Transparency="10"
                   <div class="loading"
                    <asp:Image ID="l1" runat="server" ImageUrl="~/images/loader.gif" CssClass="loader"/> 
                   </div> 
        </telerik:RadAjaxLoadingPanel> 
<asp:SqlDataSource ID="GetRankingUsers" runat="server"  
    ConnectionString="<%$ ConnectionStrings:DbSqlConnection %>"  
    SelectCommand="erepublik_users_getranking" SelectCommandType="StoredProcedure"
</asp:SqlDataSource> 

Code behind:

 Protected Sub RG1_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles RG1.PreRender 
        Dim itemCount As Integer = TryCast(sender, RadGrid).MasterTableView.GetItems(GridItemType.Item).Length + TryCast(sender, RadGrid).MasterTableView.GetItems(GridItemType.AlternatingItem).Length 
        For Each item As GridItem In TryCast(sender, RadGrid).Items 
            If TypeOf item Is GridDataItem AndAlso item.ItemIndex < itemCount - 1 Then 
                TryCast(TryCast(item, GridDataItem)("user_id"), TableCell).Controls.Add(New LiteralControl("<table style='display:none;'><tr><td>")) 
            End If 
        Next 
    End Sub 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
        Page.Title = System.Configuration.ConfigurationManager.AppSettings("tytul_small") & " | Nasza spoÅ‚eczność" 
 
        Dim Menu As GridFilterMenu = RG1.FilterMenu 
        Dim item As RadMenuItem 
 
        Dim i As Integer = 0 
        While i < Menu.Items.Count 
            If Menu.Items(i).Text = "NoFilter" Or _ 
               Menu.Items(i).Text = "StartsWith" Or _ 
               Menu.Items(i).Text = "EqualTo" Then 
                i = i + 1 
            Else 
                Menu.Items.RemoveAt(i) 
            End If 
        End While 
 
 
        For Each item In Menu.Items 
            'change the text for the StartsWith menu item 
            Dim it As String = String.Empty 
 
            Select Case item.Text 
                Case "StartsWith" 
                    item.Text = "Zaczyna siÄ™ od" 
                Case "NoFilter" 
                    item.Text = "Brak filtra" 
                Case "EqualTo" 
                    item.Text = "DokÅ‚adnie" 
            End Select 
        Next 
 
         
 
 
    End Sub 




Grzesiek
Top achievements
Rank 2
Iron
 answered on 01 Oct 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?