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

I'm using a RadComboBox in a RadGrid with RadAjaxManager set on the grid. I have found this excellent example that does exactly what I need:
https://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/comboingrid/defaultcs.aspx

The caveat is that it uses ASP.NET Session to store the selected value from the RadComboBox. I can't use the Session object as my solution runs within SharePoint and Session is disabled by default (and discouraged to use) in SharePoint environment. I have tried to use a hidden field to keep the selected value with no luck - the selected value is not kept on post back.

Is there any other mechanism than ASP.NET Session that I could use to retain the selected value of a RadComboBox?

Thanks,
Leszek

Leszek
Top achievements
Rank 1
 answered on 06 Apr 2015
9 answers
330 views

When I run the page without the Rebind() method call in my PreRender() method I get the desired filtering behavior, for the most part. We want the ComboBoxes to have a cascading data feature. When I set AppendDataBoundItems=”false” this does the trick but the user can no longer set the ComboBox to “ALL”. I put in a button to clear all the filters and that isn’t too bad. The problem I am running into now is when I have the ComboBoxes set and type in a first or last name that is invalid the page does nothing but says there is an error. I went to http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx and when you set the country to Argentina then set the filter for Is Promoted to yes the page loads http://demos.telerik.com/ErrorPageResources/error.aspx?aspxerrorpath=/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx this error. I thought that it was just a random connection but apparently your filters have the same issue that I am trying to overcome. I am guessing that you guys are aware of this issue, are there any suggestions on something that could be done? Or am I limited to trying to make the possibility of this happening as small as possible?
I also would like to have the ComboBoxes show all values that are on the same level as the current selection. For an example if it was States and Cities, and I had selected California for the state and Los Angeles for the City, I would like to click on the city combobox and have it display all cities in the state of California. Where would be a place to start looking for that possibility?

I thought maybe it would help to include a little more information from a prior question that this issue pertains to:


======================================================================================================
 



 

Posted on Nov 23, 2010 (permalink)

I wrote something that is very similar to this Demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultvb.aspx

The difference is my radgrid has sorting features enabled. After running a sort to narrow down the list, the rows no longer expand. It triggers the event, and seems to do everything else properly but does not expand the rows so that specific data is available to the user.

I would appreciate any feedback and will offer my code if it's necessary. I thought that it would be something to do with the code behind but after working on this for a day and a half I am almost certain it's some setting I missed in the aspx page. I'm still researching this issue as I work but I could really use a hint or three.

Thanks,
Oscar

Edit your post Reply

  • Oscar avatar

    Posted on Nov 23, 2010 (permalink)

    After doing some more work on this I am going to post a few snippets of where I think the error could be at this point. I have tried using a DetailTable with a GridTableView inside the radgrid. My original iteration was with the nestedtemplateview, (I prefer this version it looked nicer and was exactly what we wanted for the application I am building). I am having the same exact issue with both of these attempts. The rows expand and show the view, but once a filter has been applied to the main RadGrid it does not expand the row. 

    <MasterTableView AutoGenerateColumns="False"
        DataSourceID="SqlDataSource1"
        DataKeyNames="USER_ID"
        AllowMultiColumnSorting="true"
        Width="100%">

    <telerik:RadGrid ID="RadGrid1" runat="server"
        AllowFilteringByColumn="True"
        AllowPaging="True"
        AllowSorting="True"
        DataSourceID="SqlDataSource1"
        GridLines="None"
        Skin="Outlook"
        PageSize="100"
        EnableLinqExpressions="False"
        ShowGroupPanel="True"
        ShowStatusBar="True"
        AutoGenerateColumns="false">
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"
            AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>


        Protected Sub RadGrid1_PreRender(ByVal o As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender
     
            If Not RadGrid1.MasterTableView.FilterExpression Is String.Empty Then
     
                FilterSetter()
            End If
        End Sub
     
        Private Sub FilterSetter()
     
            sqlLocationFilter.SelectCommand = "SELECT DISTINCT [DBOL] FROM [DBO]" & " WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [Location]"
            sqlDepartmentFilter.SelectCommand = "SELECT DISTINCT [DOBD] FROM [DBO]" & " WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [DBOD]"
            sqlOfficeFilter.SelectCommand = "SELECT DISTINCT [DBOO] FROM [DBO]" & " WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [DBOO]"
     
            RadGrid1.MasterTableView.Rebind()
        End Sub
     
        Protected Sub ResetFiltersButton_OnClick(ByVal o As Object, ByVal e As EventArgs)
     
            RadGrid1.MasterTableView.FilterExpression = String.Empty
     
            For Each column As GridColumn In RadGrid1.MasterTableView.RenderColumns
     
                If TypeOf column Is GridBoundColumn Then
     
                    Dim boundColumn As GridBoundColumn = TryCast(column, GridBoundColumn)
                    boundColumn.CurrentFilterValue = String.Empty
                End If
            Next
     
            RadGrid1.Rebind()
        End Sub
     
        Protected Sub RadGrid1_ItemCommand(ByVal o As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand
     
            If e.CommandName = Telerik.Web.UI.RadGrid.ExpandCollapseCommandName Then
     
                Dim item As GridItem
     
                For Each item In e.Item.OwnerTableView.Items
     
                    TestExpandEvent.Visible = True
                    If item.Expanded And item IsNot e.Item Then
     
                        item.Expanded = False
                    End If
                Next
            End If
        End Sub
    End Class

    I hope this is enough to help,

    Oscar

    Edit your post Reply

  • Oscar avatar

    Posted on Nov 24, 2010 (permalink)

    I've found the cause of my problem but how to fix the issue is escaping me. I can't quite figure out what is stopping it from extending the rows.

    When the FilterSetter function runs as it is the rows don't expand.
    Protected Sub RadGrid1_PreRender(ByVal o As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender
        If Not RadGrid1.MasterTableView.FilterExpression Is String.Empty Then
            FilterSetter()
        End If
    End Sub
    Private Sub FilterSetter()
        SqlLocationFilter.SelectCommand = "SELECT DISTINCT [Location] FROM [View_PhoneList_Debra] " & "WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [Location]"
        SqlDepartmentFilter.SelectCommand = "SELECT DISTINCT [Department] FROM [View_PhoneList_Debra] " & "WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [Department]"
        RadGrid1.MasterTableView.Rebind()
    End Sub

    When I take the RadGrid1.MasterTableView.Rebind() line out of the code it still gives me the ability to expand the rows. But my combobox filters aren't getting set properly anymore.

    I had thought that this could help a bit, I did some testing and the event does fire and run through this function properly so I know it gets through here. I've still not found a way to solve this problem yet:

    Protected Sub RadGrid1_ItemCommand(ByVal o As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = Telerik.Web.UI.RadGrid.ExpandCollapseCommandName Then
            Dim item As GridItem
            For Each item In e.Item.OwnerTableView.Items
                If item.Expanded And item IsNot e.Item Then
                    item.Expanded = False
                End If
            Next
        End If
    End Sub

    Edit your post Reply

  • Answer Telerik Admin admin's avatar

    Posted on Nov 26, 2010 (permalink)

    Hello Oscar,

    The PreRender event is breaking your scenario. In the FilterSetter() method (called if the FilterExpression is not empty - meaning if there is a filter applied) calls RadGrid.MasterTableView.Rebind().  Rebinding is an operation that recreates all grid items in their default state. This means that, after rebinding, your items are collapsed. So what happens:

    1. You filter the grid. Now with a non-empty FilterExpression, RadGrid will rebind on every PreRender.
    2. You try to expand an item. The ItemCommand event is fired in RadGrid and the item is internally expanded, the detail table / nested view is databound.
    3. In PreRender, RadGrid is rebound, as you have applied a filter that causes FilterSetter(). At this point, your expanded item is gone, because the grid items are recreated.

    Hope this clarifies the scenario.

    Veli
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Unmark answer Reply

  • Oscar avatar

    Posted 1 day ago (permalink)

    When I run the page without the Rebind() method call in my PreRender() method I get the desired filtering behavior, for the most part. We want the ComboBoxes to have a cascading data feature. When I set AppendDataBoundItems=”false” this does the trick but the user can no longer set the ComboBox to “ALL”. I put in a button to clear all the filters and that isn’t too bad. The problem I am running into now is when I have the ComboBoxes set and type in a first or last name that is invalid the page does nothing but says there is an error. I went to http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx and when you set the country to Argentina then set the filter for Is Promoted to yes the page loads http://demos.telerik.com/ErrorPageResources/error.aspx?aspxerrorpath=/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx this error. I thought that it was just a random connection but apparently your filters have the same issue that I am trying to overcome. I am guessing that you guys are aware of this issue, are there any suggestions on something that could be done? Or am I limited to trying to make the possibility of this happening as small as possible?

     

    I also would like to have the ComboBoxes show all values that are on the same level as the current selection. For an example if it was States and Cities, and I had selected California for the state and Los Angeles for the City, I would like to click on the city combobox and have it display all cities in the state of California. Where would be a place to start looking for that possibility?

    Edit your post Reply

  • Subhashini
    Top achievements
    Rank 1
     answered on 06 Apr 2015
    4 answers
    174 views
    Hi Dear

    This problem occurred after update :

    I use this java for enable disable items in toolbar :

    function RowSelected(sender, eventArgs) {
                    var grid = sender;
                    var radToolBar = $telerik.findControl(grid.get_element(), "rtb_gridOp");

                    if (grid.get_masterTableView().get_selectedItems().length > 0) {
                        radToolBar.get_items().getItem(1).set_enabled(true);
                        radToolBar.get_items().getItem(2).set_enabled(true);
                        radToolBar.get_items().getItem(5).set_enabled(true);
                    }
                    else {
                        radToolBar.get_items().getItem(1).set_enabled(false);
                        radToolBar.get_items().getItem(2).set_enabled(false);
                        radToolBar.get_items().getItem(5).set_enabled(false);
                    }
                }

    My Radgrid toolbar:

     <CommandItemTemplate>
                                <telerik:RadToolBar ID="rtb_gridOp" runat="server" AutoPostBack="true" OnClientButtonClicking="onToolBarClientButtonClicking">
                                    <Items>
                                        <telerik:RadToolBarButton ImageUrl="/img/add-icon.png" ToolTip="<%$ Resources:Resource, newRecord %>"
                                        CommandName="InitInsert" Visible='<%# rg_chekList.EditIndexes.Count == 0 && !rg_chekList.MasterTableView.IsItemInserted %>'>
                                        </telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton ImageUrl="/img/delete-icon.png" ToolTip="<%$ Resources:Resource, deleteRecord %>" Enabled="false"
                                        CommandName="DeleteSelected" Visible='<%# rg_chekList.EditIndexes.Count == 0 && !rg_chekList.MasterTableView.IsItemInserted%>'>
                                        </telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton ImageUrl="/img/edit-icon.png" ToolTip="<%$ Resources:Resource, editRecord %>" Enabled="false"
                                        CommandName="EditSelected" Visible='<%# rg_chekList.EditIndexes.Count == 0 && !rg_chekList.MasterTableView.IsItemInserted%>' ></telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton CommandName="UpdateEdited" ImageUrl="/img/update.png" ToolTip="<%$ Resources:Resource, updateRecord %>"
                                        Visible='<%# rg_chekList.EditIndexes.Count > 0 %>'></telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton CommandName="PerformInsert" ImageUrl="/img/update.png" ToolTip="<%$ Resources:Resource, okRecord %>"
                                        Visible='<%# rg_chekList.MasterTableView.IsItemInserted %>'>
                                        </telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton CommandName="CancelAll" ImageUrl="/img/cancel.png" ToolTip="<%$ Resources:Resource, cancelRecord %>"
                                        Visible='<%# rg_chekList.EditIndexes.Count > 0 || rg_chekList.MasterTableView.IsItemInserted %>'></telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton CommandName="RebindGrid" ImageUrl="/img/reload-icon.png" ToolTip="<%$ Resources:Resource, refresh %>">
                                        </telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton CommandName="CopyItem" ImageUrl="/img/copy-icon.png" ToolTip="<%$ Resources:Resource, copyItem %>" Enabled="false">
                                        </telerik:RadToolBarButton>
                                        <telerik:RadToolBarButton CommandName="TranslateGrid_Chek" ImageUrl="/img/Translate.png" ToolTip="<%$ Resources:Resource, translationList %>" Enabled="false">
                                        </telerik:RadToolBarButton>
                                    </Items>
                                </telerik:RadToolBar>
                            </CommandItemTemplate>

    When the item is disabled Command DONT FIRE !

    I never had this problem with version 2013

    Is this a BUG?

    Please help
    Konstantin Dikov
    Telerik team
     answered on 06 Apr 2015
    9 answers
    233 views
    I have a page that I am programattically creating the grid.  The grid has ColumnGroups for grouping headers together.  As long as I do not create the ColumnGroups, the FrozenColumnsCount will work.  Once I add the ColumnGroups, the FrozenColumns now scroll even though the FrozenColumnsCount is set.

    Any ideas?

    Thanks,

    Terry
    Pavlina
    Telerik team
     answered on 06 Apr 2015
    2 answers
    229 views
    I have a RadGrid with one Details table.  I have code-behind (ItemDataBound) that sets column colors based on data from the database.  Works great.

    When expanding a Details table in any one row, the color styling in the Main table disappears.

    Please see attached for a visual example.


    --- Markup:
    <%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="NPI2._Default" EnableEventValidation="true" %>
    <%@ MasterType virtualpath="~/Site.Master" %>

    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
        <title>NPI</title>
        <script src="~/Scripts/tooltip.js" type="text/javascript"></script>
        <link href="Styles/NPI2.css" rel="stylesheet" type="text/css" />
        <link href="Styles/LogicPD.css" rel="stylesheet" type="text/css" />
    </asp:Content>
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <asp:Label ID="lbl_Error" runat="server" Text="" Font-Size="11px"></asp:Label>
        <asp:HiddenField runat="server" ID="hid_custKey" />

        <div style="display:block; width:100%; height:auto;">
            <table width="100%" border="0" style="margin-bottom:20px;">
                <tr>
                    <td class="npi_toptd1">
                        <div style="display:inline; float:left;">
                            View&nbsp;Archived:&nbsp;&nbsp;
                            <asp:CheckBox runat="server" ID="cbx_Archive" AutoPostBack="true" />
                        </div>
                        <asp:HiddenField runat="server" ID="hid_ArchCBox" Value="0" /></td>
                    <td class="npi_toptd1">
                        View&nbsp;By&nbsp;Customer:&nbsp;&nbsp;
                        <telerik:RadDropDownList ID="RadDropDownList_Customers" runat="server" DataValueField="CustomerKey" DataTextField="CustomerName" AutoPostBack="true">
                        </telerik:RadDropDownList>
                    </td>
                    <td class="npi_toptd2">
                        <asp:Button runat="server" ID="btnNewProduct" Text="Add New Product" Enabled="false" />
                    </td>
                    <td class="npi_toptd2">
                        <input runat="server" type="button" id="btnNewCustomerRedirect" value="Add New Customer" display="false" onclick="redirCustomer('AddCustomer.aspx');" />
                    </td>
                </tr>
            </table>


            
            <div style="float:left; height:90%; width:100%; overflow:auto;">

                <telerik:RadGrid ID="RadGrid_Main" runat="server"
                    DataSourceID="Sql_Data_MainTable"
                    AllowMultiRowSelection="false"
                    AllowPaging="True"
                    AlternatingItemStyle-BackColor="ControlLight"
                    AutoGenerateColumns="False"
                    AutoGenerateDeleteColumn="True"
                    AutoGenerateEditColumn="True"
                    CellSpacing="0"
                    GridLines="None"
                    GroupPanelPosition="Top"
                    Height="600px"
                    PageSize="500">
                    <ClientSettings EnablePostBackOnRowClick="false" AllowDragToGroup="False" AllowGroupExpandCollapse="True">
                        <Scrolling AllowScroll="False" UseStaticHeaders="True" />
                        <Selecting AllowRowSelect="false" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                    <HeaderStyle Font-Bold="True" />
                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    <MasterTableView
                        CommandItemDisplay="Top"
                        DataKeyNames="ProductKey"
                        DataSourceID="Sql_Data_MainTable"
                        EditMode="EditForms"
                        Name="NPI_MasterTable">
                        <EditFormSettings>
                            <EditColumn ButtonType="PushButton"></EditColumn>
                        </EditFormSettings>
                        <ExpandCollapseColumn Visible="True" HeaderStyle-Width="20px"></ExpandCollapseColumn>
                        <CommandItemSettings ShowAddNewRecordButton="true" AddNewRecordText="Add New Item"></CommandItemSettings>
                        <RowIndicatorColumn Visible="True" HeaderStyle-Width="20px"></RowIndicatorColumn>
                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                        <Columns>
                            <telerik:GridNumericColumn DataField="ProductKey" DecimalDigits="5" Display="False" HeaderText="ProductKey" UniqueName="ProductKey" ReadOnly="true"></telerik:GridNumericColumn>

                            <telerik:GridTemplateColumn HeaderText="Assembly Part Number" UniqueName="TemplateColumn_ItemID">
                                <HeaderStyle Width="150" Wrap="false" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ItemTemplate>
                                    <asp:Label ID="lbl_ItemID" runat="server" Text='<%# Eval("ItemID")%>' />
                                    <br />
                                    <asp:CheckBox id="cbx_PW" runat="server" Checked='<%# Eval("PacketWaiting") %>' Enabled="false"></asp:CheckBox>&nbsp;PW
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Textbox ID="txt_ItemID" runat="server" Text='<%# Bind("ItemID")%>' ReadOnly="false" />
                                    <br />
                                    <asp:CheckBox id="cbx_PW" runat="server" Checked='<%# Bind("PacketWaiting") %>' Enabled="true"></asp:CheckBox>&nbsp;PW
                                    <br />
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:Textbox ID="txt_ItemID" runat="server" Text='' ReadOnly="false" />
                                    <asp:RequiredFieldValidator ID="req1" runat="server" ErrorMessage="* Required" ControlToValidate="txt_ItemID" CssClass="Error tdRed"></asp:RequiredFieldValidator>
                                    <br />
                                    <asp:CheckBox id="cbx_PW" runat="server" Checked='false' Enabled="true"></asp:CheckBox>&nbsp;PW
                                    <br />
                                </InsertItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridBoundColumn DataField="AssemblyRev" HeaderText="Assy Revision" UniqueName="AssyRev">
                                <HeaderStyle Width="50" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>

                            <telerik:GridDropDownColumn DataField="CustomerKey" DataSourceID="Sql_Data_Customers" HeaderText="Customer" ListTextField="CustomerName" ListValueField="CustomerKey" UniqueName="ddCustomer">
                                <HeaderStyle Width="130" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDropDownColumn>

                            
                            <telerik:GridTemplateColumn HeaderText="Expected<br />Start Date" UniqueName="StartDate">
                                <HeaderStyle Width="60" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_StartDate" Text='<%# Eval("StartDate2")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadDatePicker ID="dateP_StartDate" runat="server" SelectedDate='<%# CType(Eval("StartDate2"), Date)%>'></telerik:RadDatePicker>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <telerik:RadDatePicker ID="dateP_StartDate" runat="server"></telerik:RadDatePicker>
                                    <asp:RequiredFieldValidator ID="req2" runat="server" ErrorMessage="* Required" ControlToValidate="dateP_StartDate" CssClass="Error"></asp:RequiredFieldValidator>
                                </InsertItemTemplate>
                            </telerik:GridTemplateColumn>
                            
                            <telerik:GridDropDownColumn DataField="Status" DataSourceID="Sql_Data_Types" HeaderText="Type" ListTextField="Type" ListValueField="TypeKey" UniqueName="Type">
                                <HeaderStyle Width="110" HorizontalAlign="Center" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDropDownColumn>
                            
                            <telerik:GridTemplateColumn HeaderText="Expected<br />Ship Date" UniqueName="ShipDate">
                                <HeaderStyle Width="60" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_ShipDate" Text='<%# Eval("ShipDate")%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadDatePicker ID="dateP_ShipDate" runat="server" SelectedDate='<%# CType(Eval("ShipDate"), Date)%>'></telerik:RadDatePicker>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <telerik:RadDatePicker ID="dateP_ShipDate" runat="server"></telerik:RadDatePicker>
                                    <asp:RequiredFieldValidator ID="req3" runat="server" ErrorMessage="* Required" ControlToValidate="dateP_ShipDate" CssClass="Error"></asp:RequiredFieldValidator>
                                </InsertItemTemplate>
                            </telerik:GridTemplateColumn>
                            
                            <telerik:GridBoundColumn DataField="ECONum" HeaderText="ECO<br />Number" UniqueName="ECONumber">
                                <HeaderStyle Width="80" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn DataField="PO_JobNumber" HeaderText="PO/<br />Job Number" UniqueName="POJob">
                                <HeaderStyle Width="80" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                            </telerik:GridBoundColumn>

                            <telerik:GridDropDownColumn DataField="CustomerFocusEng" DataSourceID="Sql_Data_CFEng" HeaderText="Customer Focus<br />Engineer" ListTextField="EngineerName" ListValueField="CustomerFocusEngKey" UniqueName="ddCFEng">
                                <HeaderStyle Width="100" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDropDownColumn>

                            <telerik:GridBoundColumn DataField="CommentsFull" HeaderText="Comments" UniqueName="CommentsFull" Display="false"></telerik:GridBoundColumn>

                            <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments..." UniqueName="Comments" ReadOnly="true">
                                <HeaderStyle Width="150" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                            </telerik:GridBoundColumn>

                            <telerik:GridDropDownColumn DataField="PasteStencils" DataSourceID="Sql_Data_Stati" ListTextField="Status" ListValueField="StatusKey" HeaderText="Stencil" UniqueName="PasteStencils">
                                <HeaderStyle Width="5" HorizontalAlign="Center" Font-Size="9px" />
                                <ItemStyle Font-Size="2px" />
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDropDownColumn>

                            <telerik:GridDropDownColumn DataField="SideSMT" DataSourceID="Sql_Data_Stati" ListTextField="Status" ListValueField="StatusKey" HeaderText="SMT" UniqueName="SMT">
                                <HeaderStyle Width="5" HorizontalAlign="Center" Font-Size="10px" /> 
                                <ItemStyle Font-Size="2px" />                           
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDropDownColumn>

                            <telerik:GridDropDownColumn DataField="Approval" DataSourceID="Sql_Data_Approval" HeaderText="Approval" ListTextField="ApprovalStatus" ListValueField="ApprovalKey" UniqueName="ddApproval">
                                <HeaderStyle Width="65" Font-Size="10px" />
                                <ItemStyle Font-Size="11px" />
                                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                    <RequiredFieldValidator ErrorMessage="&nbsp;* Required" CssClass="Error tdRed"></RequiredFieldValidator>
                                </ColumnValidationSettings>
                            </telerik:GridDropDownColumn>

                        </Columns>

                        <DetailTables>
                            <telerik:GridTableView Name="NPI_DetailsTable_Admin" runat="server"
                                DataSourceID="Sql_Data_DetailTable"
                                AllowAutomaticInserts="False"
                                AllowPaging="False"
                                AlternatingItemStyle-BackColor="#F7EED7"
                                AutoGenerateColumns="false"
                                CommandItemDisplay="Top"
                                DataKeyNames="ProductKey"
                                EditMode="PopUp"
                                EnableHeaderContextMenu="True"
                                GroupsDefaultExpanded="True" 
                                GroupLoadMode="Client"
                                HeaderStyle-ForeColor="#873F00"
                                HeaderStyle-Font-Bold="true"
                                ItemStyle-BackColor="#FAE5B4"
                                Width="100%">
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton"></EditColumn>
                                </EditFormSettings>
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="ProductKey" MasterKeyField="ProductKey" />
                                </ParentTableRelation>
                                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="true" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True" HeaderStyle-Width="20px" />
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True" HeaderStyle-Width="20px" />
                                <Columns>
                                    <telerik:GridNumericColumn DataField="ProductKey" DecimalDigits="0" Display="False" HeaderText="ProductKey" UniqueName="ProductKey" ReadOnly="true"></telerik:GridNumericColumn>
                                    <telerik:GridNumericColumn DataField="CategoryKey" DecimalDigits="0" Display="False" HeaderText="CategoryKey" UniqueName="CategoryKey" ReadOnly="true"></telerik:GridNumericColumn>
                                    <telerik:GridBoundColumn DataField="Category" HeaderText="Category" UniqueName="Category" ReadOnly="true"></telerik:GridBoundColumn>
                                    
                                    <telerik:GridBoundColumn DataField="RoHS_Color" HeaderText="RoHS_Color" UniqueName="RoHS_Color" ReadOnly="true" Display="false"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="RoHS_opt" HeaderText="RoHS_opt" UniqueName="RoHS_opt" ReadOnly="true" Display="false"></telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="RoHS<br />Requirements" UniqueName="RoHS">
                                        <HeaderStyle Width="60" Font-Size="10px" />
                                        <ItemStyle Font-Size="11px" />
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lbl_User" Text='<%# Eval("RoHS_User")%>' /><br />
                                            <asp:Label runat="server" ID="lbl_Option" Text='<%# Eval("RoHS_opt")%>' />
                                            <asp:HiddenField runat="server" ID="hid_Color_RoHS" Value='<%# Eval("RoHS_Color")%>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>
                </telerik:RadGrid>


                <%'Data Sources %>
                <asp:SqlDataSource ID="Sql_Data_MainTable" runat="server" SelectCommand="npi.GetNPIData_MainTable" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="cbx_Archive" DefaultValue="0" Name="seeArchived" PropertyName="Checked" Type="Boolean" />
                        <asp:ControlParameter ControlID="RadDropDownList_Customers" DefaultValue="1" Name="custKey" PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="Sql_Data_Customers" runat="server" SelectCommand="npi.GetCustomersAll" SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
                <asp:SqlDataSource ID="Sql_Data_Types" runat="server" SelectCommand="npi.GetType" SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
                <asp:SqlDataSource ID="Sql_Data_CFEng" runat="server" SelectCommand="npi.GetCustomerFocusEng" SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
                <asp:SqlDataSource ID="Sql_Data_Approval" runat="server" SelectCommand="npi.GetApproval" SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
                <asp:SqlDataSource ID="Sql_Data_Stati" runat="server" SelectCommand="npi.GetNPIStati" SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
                
                <asp:SqlDataSource ID="Sql_Data_DetailTable" runat="server" SelectCommand="npi.GetNPIData_DetailTable" SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="RadGrid_Main" Name="ProductKey" PropertyName="SelectedValue" Type="Int64" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
            <br />
            <div style="float:right">
                <table style="width:320px; float:right; border:1px solid black; font-size:x-small; margin-top:20px;">
                    <tr>
                        <td style="background-color: #88DD88; text-align:center;">Complete or Not Required</td>
                        <td style="background-color: #FFFFAA; text-align:center;">In Process</td>
                        <td style="background-color: #FFAAAA; text-align:center;">Hold/Not Started</td>
                    </tr>
                </table>
            </div>


        </div>
    </asp:Content>


    --- Code-behind:


    Imports System.Environment
    Imports System.Web.UI.WebControls.LoginName
    Imports System
    Imports System.Collections
    Imports System.Collections.Generic
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Text
    Imports System.Text.RegularExpressions
    Imports NPI2.DBAccess
    Imports Telerik.Web.UI
    Imports ACME_Utilities
    Imports Outlook = Microsoft.Office.Interop.Outlook
    Imports System.DirectoryServices

    Public Class _Default
        Inherits System.Web.UI.Page

    #Region "variables"
        Dim connStr As String
        Dim Environ As String
        Dim DAccess As New DBAccess
        Dim Comments_ProductID As String    'for use with Comments (productID)
        Dim prodID As String
        Dim colID As String
        Dim newProductInd As String
        Dim headerDS As New DataSet
        Dim modal3DS As New DataSet
        Dim selectedColor As String
        Dim changeInd As Boolean
        Dim includeArchive As Boolean
        Public archInd As String
        Dim sort As String
        Dim order As String
        Dim order2 As String
        Dim table2id As Int64
        Public commentKey As Int32
        Public tblb As String
        Public CustomerKey As Int32
        Public category As String
        Public userName As String
        Public RowProductKey As Int64

        Dim UpdateIndicator As Boolean
        Dim strReturnValue As String
    #End Region

        Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
            Try
                If InStr(Request.Url.ToString(), "appserver") > 0 Then Environ = "prod" Else Environ = "dev"
                connStr = System.Configuration.ConfigurationManager.ConnectionStrings(Environ).ConnectionString
                Sql_Data_Approval.ConnectionString = connStr
                Sql_Data_CFEng.ConnectionString = connStr
                Sql_Data_Customers.ConnectionString = connStr
                Sql_Data_MainTable.ConnectionString = connStr
                Sql_Data_Types.ConnectionString = connStr
                Sql_Data_DetailTable.ConnectionString = connStr
            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "PageInit")
            End Try
        End Sub

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Try
                Sql_Data_MainTable.ConnectionString = connStr
                Sql_Data_Customers.ConnectionString = connStr
                Sql_Data_Types.ConnectionString = connStr
                Sql_Data_CFEng.ConnectionString = connStr
                Sql_Data_Approval.ConnectionString = connStr
                Sql_Data_Stati.ConnectionString = connStr

                lbl_Error.Text = ""
                lbl_Error.Visible = False
                lbl_Error.ForeColor = Drawing.Color.Black
                lbl_Error.BackColor = Drawing.Color.Transparent

                hid_custKey.Value = RadDropDownList_Customers.SelectedValue
                hid_ArchCBox.Value = IIf(cbx_Archive.Checked, 1, 0)

                userName = Master.LoginName()
                If userName = "" Then userName = Context.User.Identity.Name.Replace("ACME\", "")
                If userName = "" Then userName = HttpContext.Current.Request.LogonUserIdentity.Name.ToString.Split("\"c)(1)
                If userName = "" Then userName = "uknown"

                GetCustomersForDropDownList()

                If IsPostBack Then
                    'RadGrid_Main.Rebind()
                    'RadGrid_Main.MasterTableView.ClearEditItems()   'Closes the Edit window, if it is open
                End If

            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "PageLoad")
            End Try
        End Sub

        
        Protected Sub GetCustomersForDropDownList()
            Try
                Dim dsC As New DataSet
                dsC = DBAccess.GetSPData("npi.Customers_Get_Active", "PopulateCustomerDropDown", connStr)
                RadDropDownList_Customers.DataSource = dsC.Tables(0)
                RadDropDownList_Customers.DataBind()

                'Modal:
                'RadDropDownList_Customers.DataSource = dsC.Tables(0)
                'RadDropDownList_Customers.DataBind()
            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "RadGrid_MainTable_ItemDataBound")
            End Try
        End Sub



    #Region "RadGrid_Main construction"
        Private Sub RadGrid_Main_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles RadGrid_Main.ItemCommand
            If e.CommandName = RadGrid.InitInsertCommandName Then
                e.Canceled = True
                'Prepare an IDictionary with the predefined values
                Dim newValues As New System.Collections.Specialized.ListDictionary
                'set initial checked state for the checkbox on init insert  
                newValues("cbx_PW") = False
                'Insert the item and rebind  
                e.Item.OwnerTableView.InsertItem(newValues)
            End If
        End Sub

        Private Sub radGrid_Main_ItemCreated(sender As Object, e As GridItemEventArgs) Handles RadGrid_Main.ItemCreated
            Try
                If TypeOf e.Item Is GridDataItem Then
                    Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
                    Dim deleteBtn As LinkButton = DirectCast(item.FindControl("AutoGeneratedDeleteButton"), LinkButton)
                    deleteBtn.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this row?')")
                End If

                If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
                    Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)

                    Dim txBx As TextBox = CType(editedItem("CommentsFull").Controls.Item(0), TextBox)
                    txBx.Width = 500
                    txBx.Height = 75
                    txBx.TextMode = TextBoxMode.MultiLine
                End If

                If TypeOf e.Item Is GridCommandItem Then
                    Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
                    commandItem.Width = 30
                End If

            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "radGrid_Main_ItemCreated")
            End Try
        End Sub

        Private Sub RadGrid_Main_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid_Main.ItemDataBound
            If (TypeOf e.Item Is GridDataItem) Then
                Dim dataBoundItem As GridDataItem = CType(e.Item, GridDataItem)

                If e.Item.OwnerTableView.Name = "NPI_MasterTable" Then
                    If dataBoundItem("Comments").Text = "..." Then
                        dataBoundItem("Comments").Text = ""
                        dataBoundItem("Comments").ToolTip = ""
                    Else
                        dataBoundItem("Comments").ToolTip = dataBoundItem("CommentsFull").Text
                    End If
    'Coloration: Main table
                    If dataBoundItem("Type").Text = "Box Build" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#ffaaaa")
                    ElseIf dataBoundItem("Type").Text = "Kit" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#77aaff")
                    ElseIf dataBoundItem("Type").Text = "New Assy" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#ffffaa")
                    ElseIf dataBoundItem("Type").Text = "NwAssy/ExstngPCB" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#88dd88")
                    ElseIf dataBoundItem("Type").Text = "ECO" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#C0C0C0")
                    ElseIf dataBoundItem("Type").Text = "PMONPI" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#DBE7FF")
                    ElseIf dataBoundItem("Type").Text = "ECO-New Pwb" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#FFE3AD")
                    ElseIf dataBoundItem("Type").Text = "Machine Transfer" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#DBBC97")
                    ElseIf dataBoundItem("Type").Text = "WC Transfer" Then
                        dataBoundItem("Type").BackColor = Drawing.Color.FromName("#C69DED")
                    End If

                    If dataBoundItem("PasteStencils").Text = "Hold/Not Started" Then
                        dataBoundItem("PasteStencils").ForeColor = Drawing.Color.FromName("#ffaaaa")
                        dataBoundItem("PasteStencils").BackColor = Drawing.Color.FromName("#ffaaaa")
                    ElseIf dataBoundItem("PasteStencils").Text = "In Process" Then
                        dataBoundItem("PasteStencils").ForeColor = Drawing.Color.FromName("#ffffaa")
                        dataBoundItem("PasteStencils").BackColor = Drawing.Color.FromName("#ffffaa")
                    Else
                        dataBoundItem("PasteStencils").ForeColor = Drawing.Color.FromName("#88dd88")
                        dataBoundItem("PasteStencils").BackColor = Drawing.Color.FromName("#88dd88")
                    End If

                    If dataBoundItem("SMT").Text = "Hold/Not Started" Then
                        dataBoundItem("SMT").ForeColor = Drawing.Color.FromName("#ffaaaa")
                        dataBoundItem("SMT").BackColor = Drawing.Color.FromName("#ffaaaa")
                    ElseIf dataBoundItem("SMT").Text = "In Process" Then
                        dataBoundItem("SMT").ForeColor = Drawing.Color.FromName("#ffffaa")
                        dataBoundItem("SMT").BackColor = Drawing.Color.FromName("#ffffaa")
                    Else
                        dataBoundItem("SMT").ForeColor = Drawing.Color.FromName("#88dd88")
                        dataBoundItem("SMT").BackColor = Drawing.Color.FromName("#88dd88")
                    End If

                    If dataBoundItem("ddCFEng").Text = "&nbsp;" Then dataBoundItem("ddCFEng").Text = "Select..."
                ElseIf e.Item.OwnerTableView.Name = "NPI_DetailsTable_Admin" Then
                    Dim nestedTableView As GridTableView = CType(RadGrid_Main.MasterTableView.Items(0), GridDataItem).ChildItem.NestedTableViews(0) 'not used yet

    'Coloration: details table
                    If dataBoundItem("RoHS_Color").Text = "2" Then
                        dataBoundItem("RoHS").BackColor = Drawing.Color.FromName("#FFFFAA")
                    ElseIf dataBoundItem("RoHS_Color").Text = "3" Then
                        dataBoundItem("RoHS").BackColor = Drawing.Color.FromName("#FFAAAA")
                    Else
                        dataBoundItem("RoHS").BackColor = Drawing.Color.FromName("#88DD88")
                    End If

                    Dim _lbl_RoHS_opt As Label = CType(dataBoundItem("RoHS").FindControl("lbl_Option"), Label)
                    If dataBoundItem("RoHS_opt").Text = "0" Then
                        _lbl_RoHS_opt.Text = "No"
                    Else
                        _lbl_RoHS_opt.Text = "Yes"
                    End If
                End If

            End If
        End Sub


    #End Region



    #Region "Command Events"
        'Insert into Main Table
        Private Sub RadGrid_Main_InsertCommand(sender As Object, e As GridCommandEventArgs) Handles RadGrid_Main.InsertCommand
            Try
                If e.Item.OwnerTableView.Name = "NPI_MasterTable" Then
                    'Insert code
                End If
            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "RadGrid_Main_InsertCommand")
            End Try
        End Sub

        'Update Main Table item
        Private Sub RadGrid_Main_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid_Main.UpdateCommand
            Try
                If e.Item.OwnerTableView.Name = "NPI_MasterTable" Then
                    'Update Code
                End If
            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "RadGrid_Main_UpdateCommand")
            End Try
        End Sub

        'Delete from Main Table
        Private Sub RadGrid_Main_DeleteCommand(sender As Object, e As GridCommandEventArgs) Handles RadGrid_Main.DeleteCommand
            Try
                If e.Item.OwnerTableView.Name = "NPI_MasterTable" Then
                    'Delete Code
                End If
            Catch ex As Exception
                ErrorLog_Write("NPI - Default.aspx", ex.Message, "RadGrid_Main_DeleteCommand")
            End Try
        End Sub
    #End Region



    #Region "Error Handling"
        'Write Errors to the database
        Public Sub ErrorLog_Write(ByVal page, ByVal exMessage, ByVal Err2)
            Try
                'Error handling
            Catch ex As Exception
                lbl_Error.Text = "There was an error writing to the Error Log.<br />The error was not saved.<br /><br />(Page: " + page + ")"
            End Try
        End Sub
    #End Region
    End Class






    Chris
    Top achievements
    Rank 1
     answered on 06 Apr 2015
    3 answers
    288 views

    Hi,

    How to refresh the wizard from an event inside a usercontrol that forms part of the steps.

    So for example, If I have a usercontrol inside step one and when a 'save button' in clicked in this user control, how to pass that to the wizard and change step visibility, icons etc. 

    Cheers,

    Jack

    Jon
    Top achievements
    Rank 1
     answered on 06 Apr 2015
    5 answers
    134 views
    Hi,

    I know this is probably something really simple, but I can't get it to work. I'm trying to add icons to the HeaderTemplate and make them right justified. I used span and div tags but they seem to push the icons down into the content area.

    Here's my asp page:

    <head id="Head1" runat="server">
        <title></title>
        <link href="CustomSkin/PanelBar.Salt.css" rel="stylesheet" />
         
        <style type="text/css">
            .RadPanelBar_Salt a.rpLink.GreenPanel.rpExpandable.rpExpanded {
                background-color: green;
                background-position: 0 -1000px;
                border-color: green;
            }
        </style
         
    </head>
    <body>
         
        <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
            <telerik:RadSkinManager ID="RadSkinManager1" runat="server"></telerik:RadSkinManager>
           <%--<telerik:RadButton runat="server" Text="Preview Report" ></telerik:RadButton>--%>
            <telerik:RadPanelBar ID="RadPanelBar1" runat="server"  ExpandMode="MultipleExpandedItems"  Skin="Salt" EnableEmbeddedSkins="false"  >  
                <CollapseAnimation Duration="100" Type="None" /> 
                <Items
                    <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1" CssClass="GreenPanel"  >
                        <HeaderTemplate>
                              Root Item 1
                                <asp:ImageButton ID="image1" runat="server"  ImageUrl="~/images/save_go16x16.png" /><asp:ImageButton ID="ImageButton1" runat="server"  ImageUrl="~/images/ie_16x16.png" />
                               <a class="rpExpandable">
                                   <span class="rpExpandHandle"></span>
                               </a>
                        </HeaderTemplate>                      
                        <ContentTemplate>
                            <telerik:RadTextBox ID="textbox1" runat="server" Text="text 1"></telerik:RadTextBox>
                            <telerik:RadComboBox runat="server" ID="RadComboBox1" Text="combo1"></telerik:RadComboBox>
                        </ContentTemplate>
                         
                    </telerik:RadPanelItem
                    <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2" CssClass="GreenPanel" >  
                        <HeaderTemplate>
                            Root Item 2<asp:ImageButton ID="ImageButton2" runat="server"  ImageUrl="~/images/save_go16x16.png"  />
                               <a class="rpExpandable">
                                   <span class="rpExpandHandle"></span>
                               </a>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Root Panel 2"></telerik:RadTextBox>
                            <telerik:RadComboBox runat="server" ID="RadComboBox2" Text="combo2"></telerik:RadComboBox>
                        </ContentTemplate>
                    </telerik:RadPanelItem
                    <telerik:RadPanelItem runat="server" Text="Root RadPanelItem3" CssClass="GreenPanel" >  
                        <HeaderTemplate>
                            Root Item 3<asp:ImageButton ID="ImageButton3" runat="server"  ImageUrl="~/images/save_go16x16.png"  />
                               <a class="rpExpandable">
                                   <span class="rpExpandHandle"></span>
                               </a>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <telerik:RadTextBox ID="RadTextBox3" runat="server" Text="Root Panel 3"></telerik:RadTextBox>
                            <telerik:RadComboBox runat="server" ID="RadComboBox3" Text="combo3"></telerik:RadComboBox>
                        </ContentTemplate>
                    </telerik:RadPanelItem>
                </Items
                <ExpandAnimation Duration="100" Type="None" /> 
                 
            </telerik:RadPanelBar
        </form>
    </body>
    </html>

    I also attached what my screen looks like.

    Thank you,

    Helen
    Magdalena
    Telerik team
     answered on 06 Apr 2015
    1 answer
    158 views
    I am using the Radgrid as part of a form in asp.net web forms.

    People click on "add new record" button to add a new record, fill out the entire row and then,

    instead of clicking on "insert" they just click on the "submit" button at the bottom of the page.


    I would like to detect if this has occured, and if it has, I would like the row to be inserted.

    How can I accomplish this? 

    I have already tried what is below, and it does not work.  If an item is currently being inserted, RadGrid1.Items is still 0.

    foreach (GridDataItem item in RadGrid1.Items)
                {
                    //Set the Name property for the Detail table 
                    if(item.IsInEditMode)
                    {
                        var x = "here";
                    }
                } 
    Viktor Tachev
    Telerik team
     answered on 06 Apr 2015
    13 answers
    830 views
    Hi there,

    I need to buid a survey interface and thought that RadGrid could be a good candidate for it.
    I have two datasources:
    1. with questions, with related key;
    2. answers, which has a reference to the question key.

    Idea is that I would have a radgrid with two columns:
    1. Question as bound coulmn
    2. RadioButtonList with answers.

    The problem is that I can not get two datasources marry by the question key. When I pass a parameter to answers datasource as a control radgrid SelectedValue, the second column is not showing up at all. Any recommendations would be appreciated. I paste my code below.

    Thanks,
    Yuriy

     

    <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="sqlManufacturerSurvey" 
    GridLines="None" AutoGenerateColumns="False"
    <MasterTableView DataSourceID="sqlManufacturerSurvey" DataKeyNames="QuestionID" Name="Questions" 
    HierarchyLoadMode="Client"
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings
    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"
    <HeaderStyle Width="20px"></HeaderStyle
    </RowIndicatorColumn
    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"
    <HeaderStyle Width="20px"></HeaderStyle
    </ExpandCollapseColumn
    <Columns
    <telerik:GridBoundColumn DataField="QuestionID" FilterControlAltText="Filter QuestionID column" 
    HeaderText="QuestionID" UniqueName="QuestionID"
    </telerik:GridBoundColumn
    <telerik:GridBoundColumn DataField="Question" FilterControlAltText="Filter Question column" 
    HeaderText="Question" UniqueName="Question"
    </telerik:GridBoundColumn
    <telerik:GridTemplateColumn FilterControlAltText="Filter column column" UniqueName="Answer" 
    HeaderText="Answer"
    <ItemTemplate
    <asp:RadioButtonList ID="rblAnswer" runat="server" DataSourceID="sqlResponses" DataTextField="Answer" 
    DataValueField="AnswerID" RepeatLayout="Table"
    </asp:RadioButtonList
    </ItemTemplate
    </telerik:GridTemplateColumn
    </Columns
    <EditFormSettings
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"
    </EditColumn
    </EditFormSettings
    </MasterTableView
    <FilterMenu EnableImageSprites="False"
    <WebServiceSettings
    <ODataSettings InitialContainerName=""
    </ODataSettings
    </WebServiceSettings
    </FilterMenu
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"
    <WebServiceSettings
    <ODataSettings InitialContainerName=""
    </ODataSettings
    </WebServiceSettings
    </HeaderContextMenu
    </telerik:RadGrid
    <asp:SqlDataSource ID="sqlManufacturerSurvey" runat="server" ConnectionString="<%$ ConnectionStrings:KPortal %>" 
    SelectCommand="SELECT MaterialCategory.ServiceTypeID, Question.MaterialID AS QuestionID, Question.MaterialName AS Question FROM MaterialCategory INNER JOIN Materials AS Question ON MaterialCategory.MaterialCategoryID = Question.MaterialCategoryID WHERE (MaterialCategory.MaterialCategory = 'Manufacturer Survey') AND (Question.InternalCode = 'QUESTION')"> 
    </asp:SqlDataSource
    <asp:SqlDataSource ID="sqlResponses" runat="server" ConnectionString="<%$ ConnectionStrings:KPortal %>" 
    SelectCommand="SELECT MaterialID AnswerID, MaterialName as Answer, ParentMaterialID as QuestionID FROM Materials WHERE (ParentMaterialID = @QuestionID)"> 
    <SelectParameters
    <asp:ControlParameter ControlID="RadGrid1" Name="QuestionID" 
    PropertyName="SelectedValue" /> 
    </SelectParameters
    </asp:SqlDataSource
    Sushil
    Top achievements
    Rank 1
     answered on 06 Apr 2015
    1 answer
    86 views
    On the following tutorial, the edit from is loaded on initial page load:

    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

    How can I hide it on initial load and have it appear once user click on the "edit" text on the row of the data?

    In addition, how can I use RadioButtonList in the template form with particular data selected when they click on edit link?

    Lastly, If in the edit template, if there is a section where I don't want it to show (because section is not necessary to be edited), can I hide the section of edit form template on the fly?
    Eyup
    Telerik team
     answered on 06 Apr 2015
    Narrow your results
    Selected tags
    Tags
    +? more
    Top users last month
    Rob
    Top achievements
    Rank 3
    Iron
    Iron
    Iron
    Atul
    Top achievements
    Rank 1
    Iron
    Iron
    Alexander
    Top achievements
    Rank 1
    Veteran
    Iron
    Serkan
    Top achievements
    Rank 1
    Iron
    Shawn
    Top achievements
    Rank 1
    Iron
    Iron
    Want to show your ninja superpower to fellow developers?
    Top users last month
    Rob
    Top achievements
    Rank 3
    Iron
    Iron
    Iron
    Atul
    Top achievements
    Rank 1
    Iron
    Iron
    Alexander
    Top achievements
    Rank 1
    Veteran
    Iron
    Serkan
    Top achievements
    Rank 1
    Iron
    Shawn
    Top achievements
    Rank 1
    Iron
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?