Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
215 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
130 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
90 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
277 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
79 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
6 answers
127 views
What does the error "Panic - Tree has lost its integrity" mean?  We are using version 2012.1.411.40 and loading tree view data on demand but we get this crash:

Panic - tree has lost its integrity at tc4

Ⴃ.ႭႣႠႷ.ႨႷ(ႭႣႨႳ )

 

at tc4Ⴃ.ႭႨႰႼ.ႥႳ(Stream , String , Stream , ႭႨႣႭ )

 

at tc4Ⴃ.ႭႨႰႼ.ႥႭ(Stream , Stream , ႭႨႣႭ )

 

at tc4Ⴃ.ႭႣႨႥ.ႰႨ(Stream , String , ႭႨႣႭ , Boolean )

at tc4

Ⴃ.ႤႰႨ.ႰႠ(Stream , String , Boolean )


Akash
Top achievements
Rank 1
 answered on 16 May 2017
1 answer
116 views
I'm creating a grid programatically based on the "table" a user selects from a dropdown box. I don't have the grid defined in the aspx, just a placehold for it. I want the user to be able to add a row (using the add record button) and update values (using the "edit" column). I can't find how to "wire up" getting the RadGrid1_InsertCommand and RadGrid1_UpdateCommand to be called. AllowAutomaticUpdates and AllowAutomaticInserts are false. IF I had defined the grid in the aspx page I would have included 'OnInsertCommand' and 'OnUpdateCommand', but I can't understand how to do that since I'm doing everything in the code behind. What am I missing? Any help is greatly appreciated.
Marin Bratanov
Telerik team
 answered on 16 May 2017
0 answers
125 views

Hi Telerik Team,

I have encountered a problem while using rad combobox in asp wizard where my combobox could not function, i'm using the 2016 telerik dll.

It can only function when using rendermode= native, is there any other solution beside using rendermode = native?

Before this i'm using older version of telerik dll which does not cause this problem, can you please share with us the solution regarding this?

Your response are highly appreciated. 

chee
Top achievements
Rank 1
 asked on 16 May 2017
0 answers
100 views

I am new to Telerik controls. I am using the Telerik RadGrid control, using another page in a project as reference/template.

 

I am able to assign a data source to the radgrid, but when the page is rendered nothing else is displayed.

 

Here is my grid definition

<div>
    <asp:HiddenField runat="server" ID="hfEventID" />
    <asp:HiddenField runat="server" ID="hfCompanyID" />
    <asp:HiddenField runat="server" ID="hfBoothNumber" />
    <telerik:RadGrid runat="server" ID="HelpRequestsGrid" OnNeedDataSource="HelpRequestsGrid_NeedDataSource" AutoGenerateColumns="true"
        AllowSorting="true" AllowPaging="true" PageSize="25" ShowHeader="true">
        <ClientSettings EnablePostBackOnRowClick="false" Resizing-AllowColumnResize="true" Resizing-AllowResizeToFit="true" Resizing-ShowRowIndicatorColumn="true">
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
            <Scrolling AllowScroll="True" UseStaticHeaders="true" />
        </ClientSettings>
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <ClientSettings>
            <Resizing AllowColumnResize="true" AllowResizeToFit="true" AllowRowResize="true" ResizeGridOnColumnResize="true"/>
        </ClientSettings>          
        <MasterTableView Width="100%" ClientDataKeyNames="Id" DataKeyNames="Id" AllowMultiColumnSorting="True" 
            ShowHeadersWhenNoRecords="true" Name="Master" NoMasterRecordsText="No help requests found.">
            <NoRecordsTemplate>
                No help requests found.
            </NoRecordsTemplate>
        </MasterTableView>
    </telerik:RadGrid>
</div>

 

And in my codebehind here is where I set the data source

        protected void HelpRequestsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (CompanyID > 0 && EventID > 0)
            {
                HelpRequestsGrid.DataSource = Service.GetHelpRequest(EventID, CompanyID);
            }
        }

 

When I step through the code the data source gets set but come render nothing is displayed. What am I missing?

Andrew
Top achievements
Rank 1
 asked on 16 May 2017
0 answers
72 views

I've got a radgrid with a column containing a checkbox. when i check the checkbox, I want to select a given item in a drop down list. below is what I've figured out thus far but can't quite figure out how to check the checkbox inside the grid.


<telerik:RadGrid ID="rgClientSites" runat="server" AutoGenerateColumns="False"  AllowMultiRowEdit="true" GridLines="None" Skin="Windows7">
        <MasterTableView>
            <Columns>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnUserAction="onClick"/>
        </ClientSettings>
</telerik:RadGrid>


function onClick(sender, eventArgs) {
        var grid = $find("<%= rgClientSites.ClientID %>");
        var masterTable = grid.get_masterTableView();
        var gridCheckItemLCRA = masterTable.get_dataItems()[0].findElement("2"); //contains a checkbox

var dropdownlist = $find("<%= ddlD.ClientID %>");
        var item = dropdownlist.findItemByValue("3");

        if (gridCheckItemLCRA.checked) {
   item.select();
        }
        else {
   item.unselect();
        }
    }

 

Nothing happens when I check the checkbox - how do I attach an event to an item in a cell?

 

wmj
Top achievements
Rank 1
 asked on 15 May 2017
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
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
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?