Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
204 views

Hello, 

I am currently using the checkbox template column to bind a boolean column which seems to be working fine except for one major problem. 

When I click the checkbox (changed state) I will have to click multiple times around and/or above the checkbox row location to trigger the edited flag.

I need the flag triggered in order to call my batch edit save button function. (Batch save wont trigger without having edit flag up)

Everything seems to be binding properly without issue but except for getting the flag to trigger. Again, only multiple clicks around the checkbox will finally trigger the flag (exact position isn't clear). 

 

Best, 

-R

 

ASP Code:

 

<telerik:GridTemplateColumn ColumnEditorID="CompletedBox" Reorderable="true" AllowSorting="true" HeaderText="Complete" >
                  <HeaderStyle Width="60px" />
                  <ItemStyle CssClass="float-right" />
                   <ItemTemplate> 
                    <asp:CheckBox ID="CheckBox3" runat="server" Checked='<%# Bind("CompletedAsBool") %>' /> 
                   </ItemTemplate>
                  <EditItemTemplate >
                    <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("CompletedAsBool") %>' />
                  </EditItemTemplate>
</telerik:GridTemplateColumn>

Vessy
Telerik team
 answered on 17 May 2017
4 answers
519 views
Hi,
On client side  button click event, I want to get control id that are place in Item template of List-view
swarupa
Top achievements
Rank 1
 answered on 17 May 2017
1 answer
142 views
Hi 
I have a RadTabStrip with 3 tabs which has a User Control on each tab. Each User Control has a Radgrid on it, I am trying to add filtering to some of the columns. The filters are showing but has no response when entering anything in them, they just don't do anything at all..
Please advise me on this, here is my markup:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RadGridsUserControlCS.ascx.cs" Inherits="RadGridsUserControlCS1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<div>

    <asp:Label ID="lblEmpID" runat="server"></asp:Label>

    <br />
    <br />

    <asp:Label ID="Label1" runat="server" Text="Project:"></asp:Label>

    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource4" DataTextField="projno" DataValueField="dbcsuffix">
    </asp:DropDownList>

    <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:DMCONFIGConnectionString %>" SelectCommand="SELECT projno, dbcsuffix FROM fProject"></asp:SqlDataSource>

    <br />

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridFilesDisplay" >
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridFilesDisplay" LoadingPanelID="RadAjaxLoadingPanel1" />                
                </UpdatedControls>          
            </telerik:AjaxSetting>      
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista" ></telerik:RadAjaxLoadingPanel>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">

            function onRequestStart(sender, args)
            {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 || args.get_eventTarget().indexOf("ExportToPdfButton") >= 0)
                {
                    args.set_enableAjax(false);
                }
            }

        </script>    

         <script type="text/javascript">

             function openDocumentComments(position, Documentno)
             {
                 var oWnd = radopen("DocumentComments.aspx?position=" + position, + "&Documentno=" + Documentno, "DocumentComments");
                 oWnd.center();
             }

             function RefreshPageForGrid()
             {
                 window.location.href = "RadGridsUserControlCS.aspx";
             }

         </script> 

        <script  type="text/javascript">

                    Sys.Application.add_load(AppLoad);

                    function AppLoad() {
                        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
                        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequest);
                    }

                    function BeginRequest(sender, args) {
                        // Clear the error if it's visible from a previous request.
                        if ($get('Error').style.visibility == "visible")
                            CloseError();
                    }

                    function EndRequest(sender, args) {
                        // Check to see if there's an error on this request.
                        if (args.get_error() != undefined) {
                            // If there is, show the custom error.
                            $get('Error').style.visibility = "visible";

                            // Let the framework know that the error is handled, 
                            //  so it doesn't throw the JavaScript alert.
                            args.set_errorHandled(true);
                        }
                    }

                    function CloseError() {
                        // Hide the error div.
                        $get('Error').style.visibility = "hidden";
                    }
        </script>

    </telerik:RadCodeBlock>

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">

        <Windows>

            <telerik:RadWindow Skin="Vista" ID="DocumentComments" runat="server" Title="Document Comments"
                Height="400px" Width="300px" Left="150px" ReloadOnShow="true" Modal="true" 
                OpenerElementID="btnProjReject" NavigateUrl="~/DocumentComments.aspx"/>

        </Windows>

    </telerik:RadWindowManager>

    <br />

</div>

<div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            

            <telerik:RadGrid ID="gridFilesDisplay" 
                Skin="WebBlue" 
                runat="server" 
                AutoGenerateColumns="False" 
                OnNeedDataSource="gridFilesDisplay_NeedDataSource" 
                OnItemCommand="gridFilesDisplay_ItemCommand" 
                OnPreRender="gridFilesDisplay_PreRender" 
                OnLoad="gridFilesDisplay_Load"
                OnItemDataBound="gridFilesDisplay_ItemDataBound" 
                AllowFilteringByColumn="True">

                    <ClientSettings EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>

                    <MasterTableView DataKeyNames="position" CommandItemDisplay="Top">

                        <DetailTables>

                            <telerik:GridTableView DataKeyNames="position,category" DataSourceID="SqlDataSource2" Width="100%" runat="server" Name="Categories">

                                <DetailTables>
                                    <telerik:GridTableView runat="server" DataKeyNames="position,category" DataSourceID="SqlDataSource3" Name="Documents" Width="100%">

                                        <ParentTableRelation>
                                            <telerik:GridRelationFields DetailKeyField="category" MasterKeyField="category" />
                                        </ParentTableRelation>

                                        <Columns>

                                            <telerik:GridTemplateColumn DataType="System.Char"  UniqueName="DocumentComments" DataField="DocumentComments" AllowFiltering="false" FilterControlAltText="test"><%--HeaderText="Appr/Reject"--%>

                                               <ItemTemplate>

                                                   <a href="#"  style="text-decoration:none; color: red" onclick="openDocumentComments('<%# DataBinder.Eval(Container.DataItem, "position") %>, <%# DataBinder.Eval(Container.DataItem, "Documentno") %>'); return false;">Reviewed</a> 
                                               
                                               </ItemTemplate>
                           
                                                <EditItemTemplate>

                                                    <%--<asp:Button runat="server" ID="btnDocApprove" Text="Approve" Width="60px" OnClick="btnDocApprove_Click" />--%>

                                                    <%--<a href="#" onclick="openDocRadWindow('<%# DataBinder.Eval(Container.DataItem, "WBSEmpDocId") %>', '<%# DataBinder.Eval(Container.DataItem, "LineNbr") %>'); return false;" style="color: red">Reject</a>--%>

                                                </EditItemTemplate>

                                                <HeaderStyle Width="12%" Font-Bold="True" />
                                                <ItemStyle Font-Bold="true" HorizontalAlign="Center"/>

                                            </telerik:GridTemplateColumn>


                                            <telerik:GridBoundColumn DataField="position" HeaderText="Position" UniqueName="position" Visible="false" AllowFiltering="false">
                                                
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="category" HeaderText="Category" UniqueName="category" Visible="false" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="Documentno" HeaderText="Document No" UniqueName="Documentno" AllowFiltering="true">
                                                
                                                <HeaderStyle Font-Bold="true" Width="10%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="Rev_Now" HeaderText="Rev Now" UniqueName="Rev_Now" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" Width="10%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="STS_Now" HeaderText="STS Now" UniqueName="STS_Now" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" Width="10%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="MDR_Title" HeaderText="MDR Title" UniqueName="MDR_Title" AllowFiltering="true" FilterControlWidth="100px" >
                                                
                                                <HeaderStyle Font-Bold="true" Width="35%" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="storename" HeaderText="storename" UniqueName="storename" Visible="false" AllowFiltering="false">
                                                
                                                <HeaderStyle Font-Bold="true" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridTemplateColumn HeaderText="Download Document" AllowFiltering="false">

                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# Eval("storename") %>' CommandName="DownloadMyFile" Text="Download"></asp:LinkButton>
                                                    <%--<telerik:RadButton RenderMode="Lightweight" ID="DownloadMyFile" OnClientClicked="DownloadMyFile" CommandName="DownloadMyFile" Text="Download" AutoPostBack="false" runat="server" Width="90px">
                                                    </telerik:RadButton>--%>
                                                    <%--Text='<%# Eval("storename") %>'--%>
                                                </ItemTemplate>

                                                <HeaderStyle Font-Bold="true" />
                                            </telerik:GridTemplateColumn>

                                        </Columns>

                                    </telerik:GridTableView>
                                </DetailTables>

                                <ParentTableRelation>

                                    <telerik:GridRelationFields DetailKeyField="position" MasterKeyField="position"></telerik:GridRelationFields>

                                </ParentTableRelation>

                                <Columns>

                                    <telerik:GridBoundColumn HeaderText="Position" DataField="position" UniqueName="position" Visible="false" AllowFiltering="false">
                                        
                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn HeaderText="Category" DataField="category" UniqueName="category" AllowFiltering="false">
     
                                        <HeaderStyle Width="10%" Font-Bold="true" />

                                    </telerik:GridBoundColumn>

                                    <telerik:GridBoundColumn HeaderText="Category Description" DataField="categorydesc" UniqueName="categorydesc" AllowFiltering="false">

                                        <HeaderStyle Width="90%" Font-Bold="true" />

                                    </telerik:GridBoundColumn>

                                </Columns>

                            </telerik:GridTableView>

                        </DetailTables>

                        <Columns>

                            <telerik:GridBoundColumn HeaderText="Position" DataField="position" UniqueName="position" Visible="false" AllowFiltering="false">
                                
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="First Name" DataField="firstname" UniqueName="firstname" AllowFiltering="false">

                                <HeaderStyle Width="20%" Font-Bold="true" />

                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Last Name" DataField="lastname" UniqueName="lastname" AllowFiltering="false">

                                <HeaderStyle Width="80%" Font-Bold="true" />

                            </telerik:GridBoundColumn>

                        </Columns>
                    </MasterTableView>

            </telerik:RadGrid>

            <asp:Button ID="btnApprove" runat="server" Text="Approve" Visible="false" OnClick="btnApprove_Click" />

        </ContentTemplate>
    </asp:UpdatePanel>
</div>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DocViewConnectionString %>"
    DeleteCommand=""
    InsertCommand=""
    SelectCommand="xLevel1Names" SelectCommandType="StoredProcedure"
    UpdateCommand="" UpdateCommandType="Text" >
       
    <SelectParameters>

        <asp:SessionParameter Name="User" SessionField="User" Type="String" />
      <%--  <asp:SessionParameter Name="User" SessionField="User" Type="String" />--%>

    </SelectParameters>

</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DocViewConnectionString %>"
    DeleteCommand=""
    InsertCommand=""
    SelectCommand="xLevel2Categories" SelectCommandType="StoredProcedure"
    UpdateCommand="" UpdateCommandType="Text" >
       
    <SelectParameters>

        <asp:SessionParameter Name="User" SessionField="User" Type="String" />

    </SelectParameters>

</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:DocViewConnectionString %>"
    DeleteCommand=""
    InsertCommand=""
    SelectCommand="xLevel3Docs" SelectCommandType="StoredProcedure"
    UpdateCommand="" UpdateCommandType="Text" >
       
    <SelectParameters>

        <asp:SessionParameter Name="User" SessionField="User" Type="String" />

        <asp:Parameter Name="category" Type="String" />

    </SelectParameters>

</asp:SqlDataSource>

<br />

<asp:Label ID="lblMessage" runat="server"></asp:Label>
Marin Bratanov
Telerik team
 answered on 17 May 2017
4 answers
133 views

Hello,

 

I just came across an issue trying to enable/disable the Treeview control

It is declared this way : 

<telerik:RadTreeView RenderMode="Classic" runat="Server" ID="trProvince" Height="350" CheckBoxes="True" TriStateCheckBoxes="true"  CheckChildNodes="true" OnClientNodeClicked="ClientNodeClicked" Enabled="False" CssClass="Province"  >

 

Next of it, there's a checkbox that allows to enable/disable it

 

Here's the JS doing that : 

function ToggleRow(sender, eventArgs) {
    var rowClass = "." + sender.get_id().substring(3);
    var isChecked = sender.get_checked();
 
    console.log(rowClass);
    console.log(isChecked);
 
    $(rowClass).each(function() {
        $(this).each(function () {
            var element = $find($(this)[0].id);
 
            console.log(element);
            console.log("enabled :" + element.get_enabled());
 
            if (isChecked) {
                element.enable && element.enable();
                element.set_enabled && element.set_enabled(true);
            } else {
                element.disable && element.disable();
                element.set_enabled && element.set_enabled(false);
            }
                                 
        });
    });
}

 

It's working as in : When checkbox is checked, I can click the checkboxes in the TreeView, expand/collapse its node but it still has a "disabled" style (greyed)

How do I get it to remove the grey layer on the control?

Thank you 

Telerik version : 2017.1.118

Peter Milchev
Telerik team
 answered on 17 May 2017
1 answer
257 views

Within a step of my radwizard I need a button that is supposed to dynamically add some fields to my form as needed. No matter what I do, the button click event won't fire. What am I missing? I've added a simple demo to demonstrate:

<telerik:RadWizard RenderMode="Lightweight" ID="RadWizardIncidentGroupA" runat="server" CssClass="formfont" Width="100%" OnClientLoad="OnClientLoad" Skin="Bootstrap"
OnClientButtonClicking="OnClientButtonClicking"
OnFinishButtonClick="RadWizardIncidentGroupA_FinishButtonClick" 
 OnCancelButtonClick="RadWizardIncidentGroupA_CancelButtonClick"
BorderColor="#cccccc">
<WizardSteps>
     <telerik:RadWizardStep ID="RadWizardStep1" Title="Administrative" StepType="Start" DisplayCancelButton="true" 
                 runat="server">
                    <div class="inputWrapper">
                         <asp:Label ID="lblTest" Text="Test1" runat="server"></asp:Label>
                         <asp:Button ID="ChangeText" runat="server" Text="Add an Offense" OnClick="ChangeText_Click" />
                    </div>
               </telerik:RadWizardStep>

         </WizardSteps>

</telerik:RadWizard>

 

CODEBEHIND:

protected void ChangeText_Click(object sender, EventArgs e)
{
            lblTest.Text = "Test2";
}

chee
Top achievements
Rank 1
 answered on 17 May 2017
6 answers
221 views

Hi, I have a page that contains a RadComboBox that let's the user select a group name and a RadGrid that displays the members of the selected group.  I have added a setting to the RadAjaxManager to make the combo box update the grid.  That part seems to be working as the loading panel is shown over the grid each time I pick a different value from the combo box.  The problem is that the data in the grid doesn't change, unless I click the refresh button on the grid.

 

I set a breakpoint in my NeedDataSource event handler and I can see that the AJAX request occurs, but the handler is not invoked.  Is this the expected behavior?  If so, what is the correct way to achieve my desired outcome?

 

<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
   <AjaxSettings>
     <telerik:AjaxSetting AjaxControlID="RadComboBoxCustomGroups2">
       <UpdatedControls>
         <telerik:AjaxUpdatedControl ControlID="RadGridGroupMembers" LoadingPanelID="RadAjaxLoadingPanel" />
       </UpdatedControls>
     </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>

 

<asp:Panel ID="CustomizeCustomGroupPanel" runat="server" GroupingText="Customize Custom Group" Width="635px">
  <div>
    <div class="InlineTable">
      <telerik:RadComboBox ID="RadComboBoxCustomGroups2" runat="server"
                           DataSourceID="SqlDataSourceCustomGroups" DataTextField="Group_Name"
                           DataValueField="Group_Id" CssClass="radcombobox" AutoPostBack="True" />
    </div>
  </div>
  <br />
  <div>
    <div>
      <telerik:RadGrid ID="RadGridGroupMembers" runat="server" CssClass="RadGrid_site" ClientSettings-Selecting-AllowRowSelect="true"
                       AutoGenerateColumns="false" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" OnNeedDataSource="RadGridGroupMembers_NeedDataSource"
                       OnUpdateCommand="RadGridGroupMembers_UpdateCommand" OnInsertCommand="RadGridGroupMembers_InsertCommand">
        <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="Branch_Id">
          <Columns>
            <telerik:GridEditCommandColumn />
            <telerik:GridBoundColumn DataField="Branch_Id" HeaderText="Branch ID" UniqueName="Branch_Id" ReadOnly="true" Display="false">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Branch Name" UniqueName="Branch_Name">
              <EditItemTemplate>
                <asp:DropDownList runat="server" DataValueField="Branch_Name" DataSourceId="SqlDataSourceCustomGroupBranchesSource">
                </asp:DropDownList>
              </EditItemTemplate>
              <ItemTemplate>
                <asp:Label runat="server" ReadOnly="true" Text='<%# Eval("Branch_Name") %>'>
                </asp:Label>
              </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridDateTimeColumn DataField="Expiration" HeaderText="Expiration" UniqueName="Expiration" ReadOnly="false">
            </telerik:GridDateTimeColumn>
          </Columns>
        </MasterTableView>
      </telerik:RadGrid>
    </div>
  </div>
</asp:Panel>

Craig
Top achievements
Rank 1
 answered on 17 May 2017
4 answers
131 views

I have a grid with a ClientSelectedItem column and an item template column with a list in it. When the page loads the ClientSelectedItem is disabled. I want to enable it client side when a value is selected in the dropdown, or change it back to disabled if they change the selection in the dropdown back to nothing. Here's the column section of the grid.

<Columns>
    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="47px" />
    <telerik:GridBoundColumn DataField="CaseId" UniqueName="CASEID" Visible="false" />
    <telerik:GridTemplateColumn UniqueName="FIRSTLASTNAMES" ShowFilterIcon="false" DataField="FIRSTLASTNAMES"
        SortExpression="FIRSTLASTNAMES" HeaderText="Soldier" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true"
        HeaderStyle-Width="150px">
        <ItemTemplate>
            <asp:LinkButton ID="lnkBtnName" runat="server" Text='<%# Eval("FIRSTLASTNAMES") %>' CommandArgument='<%# Eval("CASEID") %>'
                CommandName="Popup" />
        </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridBoundColumn UniqueName="SSN" HeaderText="SSN" DataField="SSN" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" HeaderStyle-Width="50px" />
    <telerik:GridBoundColumn UniqueName="COMPANYNAME" HeaderText="CO" DataField="CompanyName" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" HeaderStyle-Width="30px" />
    <telerik:GridBoundColumn UniqueName="PLATOON" HeaderText="PLT" DataField="PLATOON" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" HeaderStyle-Width="30px" />
    <telerik:GridBoundColumn UniqueName="SQUADRON" HeaderText="SQD" DataField="SQUADRON" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" HeaderStyle-Width="30px" />
    <telerik:GridBoundColumn UniqueName="CDR" HeaderText="CDR" DataField="CDR" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
    <telerik:GridBoundColumn UniqueName="SW" HeaderText="SW" DataField="SW" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
    <telerik:GridBoundColumn UniqueName="OT" HeaderText="OT" DataField="OT" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
    <telerik:GridBoundColumn UniqueName="NCM" HeaderText="NCM" DataField="NCM" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
    <telerik:GridBoundColumn UniqueName="PSG" HeaderText="PSG" DataField="PSG" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
    <telerik:GridBoundColumn UniqueName="SL" HeaderText="SL" DataField="SL" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
    <telerik:GridTemplateColumn UniqueName="SLSelection" ShowFilterIcon="false" DataField="SL"
        SortExpression="SL" HeaderText="Select SL" Visible="true">
        <ItemTemplate>
            <telerik:RadDropDownList ID="ddlSelectedSqdLdr" runat="server" Width="100" OnClientItemSelected="modifySelection" DefaultMessage="Select...">
            </telerik:RadDropDownList>
            <asp:HiddenField ID="tranferCaseId" runat="server" Value='<%# Eval("CASEID") %>' />
        </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridBoundColumn UniqueName="TC" HeaderText="TC" DataField="TC" ShowFilterIcon="false"
        DataType="System.String" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
</Columns>

 

Thanks

Rodney

Rodney
Top achievements
Rank 2
 answered on 16 May 2017
6 answers
92 views

Hello,

I know there is an example how to show and hide the loading panel over one single page-element at the documentation. But I wonder if it is possible to show and hide the loading panel over multiple elements of the page, e.g. over a toolbar at the top and a grid at the bottom of the page.

Thanks in advance.

Kind regards

Felix

Loïc
Top achievements
Rank 1
 answered on 16 May 2017
3 answers
282 views

Hello,

I saw many posts with issues on filters, but none of them looks similar to my issue.
The classic filter works perfectly but the Checklist filter doesn't. If I try Combined, the classic functionnality works and the checklist doesn't.
Please note that I tried to change the binding way for my grid (using the NeedDataSource event), but it doesn't change anything. The classic filter is still working while the checklist filter still doesn't.

Here is some part (that I think pertinent) of my code. I generate everything from code behind in the Page_Load method:

var grid = new RadGrid();
grid.DataSourceID = myDataSource;
grid.AllowPaging = false;
grid.ColumnCreated += Grid_ColumnCreated;
grid.AutoGenerateColumns = true;
grid.AllowFilteringByColumn = true;
grid.FilterType = GridFilterType.Combined;
grid.FilterCheckListItemsRequested += Grid_FilterCheckListItemsRequested;
grid.ClientSettings.Scrolling.AllowScroll = true;
grid.ClientSettings.Scrolling.UseStaticHeaders = true;
grid.MasterTableView.TableLayout = GridTableLayout.Auto;

grid.ItemCommand += Grid_ItemCommand;

protected void Grid_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
{
    RadGrid grid = sender as RadGrid;
    if (e.Column is GridBoundColumn)
    {
        GridBoundColumn column = (GridBoundColumn) e.Column;
        column.AutoPostBackOnFilter = true;
        column.FilterCheckListEnableLoadOnDemand = true;
        column.CurrentFilterFunction = GridKnownFunction.Contains;
    }
}
private void Grid_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            string dataField = (e.Column as IGridDataColumn).GetActiveDataField();
 
            var grid = sender as RadGrid;
            var ds = grid.DataSourceObject as SqlDataSource;
            Regex reg = new Regex("FROM(.+)ORDER");
            string request = "SELECT DISTINCT t." + dataField + " " + reg.Match(ds.SelectCommand).Value + " BY t." + dataField + " ASC";
 
            e.ListBox.DataSource = GetFilterTable(request);
            e.ListBox.DataKeyField = dataField;
            e.ListBox.DataTextField = dataField;
            e.ListBox.DataValueField = dataField;
            e.ListBox.DataBind();
        }

 

The FilterCheckListItemsRequested is working and I have, for each columns, 1 checkbox for each different values inside. Notice however how I had to make a Regex on the SelectCommand as I don't know which grid I'm in inside this event. (If someone has a better way ?).

Anyway, regarding the checklist filter, when I check a checkbox and click on "Apply", a postback is done and the Grid_ItemCommand event is raised. However it looks like the "filter value" is empty.

private void Grid_ItemCommand(object sender, GridCommandEventArgs e)
{
    if(e.CommandName == RadGrid.FilterCommandName)
    {
        GridFilteringItem filter = (GridFilteringItem) e.Item;
        string value = ((filter[currentCol].Controls[0]) as TextBox).Text;
         
        Pair command = (Pair) e.CommandArgument;
 
        /* IF CLASSIC FUNCTIONNALITY IS USED
        *   command.First = "Contains"
        *   command.Second = myColumnName
        *   value = theFilterStringIInputed
        */
         
        /* IF CHECKLIST FUNCTIONNALITY IS USED
        *   command.First = "5"
        *   command.Second = myColumnName
        *   value = Empty
        */
    }
}

 

Does someone know how to get the values of the selected checkbox ?

Or what did I do wrong here ?

Thank you.
Regards,
Guilhem

 

 

Vessy
Telerik team
 answered on 16 May 2017
0 answers
82 views

Hi

AppointmentInserting function, i am showing one menu and it is working correct but if the click out side Insert it should hide the menu can you please help how i can achieve this.

Matt
Top achievements
Rank 1
 asked on 16 May 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?