Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
187 views
Hi,

Find checkbox in the header of the RadGrid. I am looking for c# code. I am having the button outside radgrid. I am looping through the dataitem to find other columns.

I need to find am method to find the contorl in the header.

Thanks in advance.


Angie
Top achievements
Rank 1
 answered on 08 May 2018
1 answer
96 views

We have updated Telerik from 2010.3.1109.35 to 2018.1.177.45 and also our Website from .NET 3.5 to .NET 4.7

We now find that our AJAX driven paging on our User Controls is no longer working and it ends up just posting back rather than updating the User Control.

For example, when clicking the Page Right button or jumping to a page the Loading Panel is displayed but then a full page refresh occurs and nothing has updated.

 

Lee
Top achievements
Rank 1
 answered on 08 May 2018
6 answers
1.0K+ views
hey everyone,

I want to validate a button such that if combobox selected items count is equal to zero then button click will show an alert on client side. I am doing this:
function filterSearch()
{
  var combo = $find('<%=RadComboBox1.ClientID %>');
  var textbox = document.getElementById("txtSearch");
  var selectedItemsCount = combo.get_selectedItems().length;
  if (selectedItemsCount == 0)
  {
    alert("You must select a category before processing search!");
    return false;
  }
}
This ain't working though. This is my button:
<asp:Button ID="btnSearch" runat="server" Style="float: left; color: black; font-weight: bold" Text="Search" OnClick="btnSearch_Click" OnClientClick="javascript: return filterSearch();" />
How can I do this?

Thanks,
Amit

Marin Bratanov
Telerik team
 answered on 08 May 2018
0 answers
141 views

I have a simple RadGrid with this design:

<div id="Grid">
                    <telerik:RadGrid RenderMode="Lightweight"
                         runat="server"
                         AllowPaging="true"
                         ID="RadGrid1"
                         AutoGenerateColumns="false"
                         OnItemCommand="RadGrid1_ItemCommand"
                         OnItemCreated="RadGrid1_ItemCreated"
                         OnPreRender="RadGrid1_PreRender1"
                         OnItemDataBound="RadGrid1_ItemDataBound"
                         OnNeedDataSource="RadGrid1_NeedDataSource"
                         AllowAutomaticDeletes="false"
                         AllowAutomaticInserts="true"
                         AllowAutomaticUpdates="true"
                         >
                        <MasterTableView DataKeyNames="UserID"
                             CommandItemDisplay="Top"
                             InsertItemPageIndexAction="ShowItemOnCurrentPage">
                            <Columns>
 
                                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                                </telerik:GridEditCommandColumn>
                                <telerik:GridBoundColumn DataField="UserID" HeaderText="User ID" ReadOnly="true"
                                    ForceExtractValue="Always" ConvertEmptyStringToNull="true" Visible="false"/>
                                <telerik:GridTemplateColumn UniqueName="ActiveColumn" HeaderText="Active">
                                    <ItemTemplate>
                                        <asp:Label ID="lblActive" runat="server" Text='<%# Convert.ToBoolean(Eval("Active")) == true ? "Yes" : "No" %>'></asp:Label>
                                    </ItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:CheckBox runat ="server" ID="chkInsertActive" />
                                    </InsertItemTemplate>
                                    <EditItemTemplate>
                                        <asp:CheckBox runat="server" ID ="chkActive" Checked='<%# DataBinder.Eval(Container.DataItem,"Active") %>'  />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Role">
                                    <ItemTemplate>
                                            <%#DataBinder.Eval(Container.DataItem,"Role") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlRole" runat="server" ></asp:DropDownList>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn UniqueName="FirstNameColumn" HeaderText="First Name">
                                    <ItemTemplate>
                                            <%# DataBinder.Eval(Container.DataItem,"FirstName") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="* First Name Is Required" ForeColor="Red"
                                             ControlToValidate="txtFirstName"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Last Name">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "LastName") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="* Last Name Is Required" ForeColor="Red"
                                             ControlToValidate="txtLastName"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="User Name">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "UserName") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="* User Name Is Required" ForeColor="Red"
                                             ControlToValidate="txtUserName"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Email Address">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "EmailAddress") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("EmailAddress") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="* Email Is Required" ForeColor="Red"
                                             ControlToValidate="txtEmail"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn>
                                    <ItemTemplate>
                                        <asp:Button ID="btnDelete" CssClass="btn btn-xs btn-danger" Text="Delete" runat="server" OnClick="BtnDelete_Click" OnClientClick="confirmAspButton(this); return false;">
                                        </asp:Button>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
 
                        </MasterTableView>
                        <PagerStyle Mode="NextPrevAndNumeric" />
                    </telerik:RadGrid>
                </div>

 

 Then I created C# code to filter the Grid by user and or Role with this code.  I am not showing all of the code just enough to give a picture of what I am working with:

if (txtName.Text.Length > 0 && ddlRole.SelectedIndex == 0)
{
    string a = txtName.Text;
    using (ExpungeEntities db = new ExpungeEntities())
    {
        RadGrid1.DataSource = db.USERS_T_DATA.Where(c => c.FirstName.Contains(a)
            || c.LastName.Contains(a)).ToList();
        {
            RadGrid1.Rebind();
            int intGridCount = RadGrid1.Items.Count;
            if (intGridCount == 0)
            {
                DisplayMessage("No records matched your search");
                txtName.Text = string.Empty;
            }
        }
         
         
    }
}

 

The code works as expected and I endup with a filtered grid. but here is the issue I am trying to solve.  When I click the "edit" icon that was created by my use of the AllowAutomaticUpdates I am presented with the first row in the grid for updating instead of the intended row.  I have taken a screen shot that shows the issue to help explain.

How can I get the correct row to display for edit?

 

Perry
Top achievements
Rank 1
 asked on 08 May 2018
0 answers
192 views

I had done out of the box customization for RadGrdi in batch edit mode.

For some reason I had set AllowKeyBoardNavigation = 'false'.

(If I set it as true the horizontal scroll works wired, which i already raised in the forum)

https://www.telerik.com/forums/weird-behavior-of-radgrid's-horizontal-scroll-bar-with-keyboard-navigation-in-ie-browser

 

Now I want that on hitting Esc if is there any cell in Active Edit Mode then it should close the editing for that particular cell only. and I want to achieve this functionality using client-side code.

Smit
Top achievements
Rank 1
 asked on 08 May 2018
0 answers
136 views

Hi,

I've got a chart that has 1 scatter line series plotted on it with dates on the x axis and numbers on the y axis. Every time i zoom in then zoom out, less is visible than was available before. I also have pan enabled and you can't pan up to the hidden values anymore either. Is this a configuration I'm missing? I attached pictures to show, I assure you I tried zooming out as far as it would let me

Zach
Top achievements
Rank 1
 asked on 07 May 2018
0 answers
180 views

I found the inconsistent behavior (Focus moved at a different place) of selecting the cell in Rad grid for IE Browser.

 

 As I had 15 columns displayed in my grid. So, I get horizontal scrollbar definitely.

For selecting any cell of the last column I scroll horizontally and try to select any cell.

As soon as I click on any cell the scroll reset to its default position although the cell would be selected.

PS. This will only happen if I had set property ## AllowKeyboardNavigation="true" ##

Smit
Top achievements
Rank 1
 asked on 07 May 2018
0 answers
123 views

HI,

 

In RAD Grid can we have export to Excel functionality export the data in an .xlsx file instead of a .xls file , because in our application we have to export 180K records , and in xls it is giving out of memory error , we were hoping that if we could export It to .xlsx this error might not come.

 

Thanks

Hemant.

Hemant
Top achievements
Rank 1
 asked on 07 May 2018
1 answer
930 views
I have a problem with batch grid mode.
I have a RadDatePicker in <HeaderTemplate> as the example below:
<telerik:GridTemplateColumn UniqueName="dtLimite" HeaderText="Data Limite" HeaderStyle-Width="90px"
                            Visible="true" AllowFiltering="False" DataField="dtLimite" HeaderStyle-HorizontalAlign="Center"
                            ColumnGroupName="Datas" ItemStyle-HorizontalAlign="Center">
                            <HeaderTemplate>
                                <div>
                                    <asp:Label Text="Limite" runat="server" />
                                </div>
                                <telerik:RadDatePicker ID="dpLimite" runat="server" ToolTip="Alterar Todas" DateInput-DisplayText="Alterar Todas"
                                    Skin="Bootstrap" class="form-control" MinDate="01/01/1910" AutoPostBack="true" Width="150px"
                                    OnSelectedDateChanged="dpLimite_SelectedDateChanged1"  >                                         
                                                    </telerik:RadDatePicker>
                            </HeaderTemplate>
                            <ItemTemplate><telerik:RadDatePicker ID="dpLimite2" runat="server" Skin="Bootstrap" AutoPostBack="false" class="form-control" MinDate="01/01/1910" SelectedDate='<%# Eval("dtLimite") %>'></telerik:RadDatePicker>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDatePicker ID="dpLimite1" runat="server" Skin="Bootstrap" AutoPostBack="false" class="form-control" MinDate="01/01/1910"></telerik:RadDatePicker>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
      
      
In the OnSelectedDateChanged = "dpLimite_SelectedDateChanged1" component´s event,
I change the value of the cells of all the other lines ( this is working the exchange of dates ),
and I need the grid to recognize that these changes were made and that at the time of saving the batch
all lines are in edit mode, which is not happening.
I need this done not only with the date columns, but also with the Check columns,
as you can see.
The check , uncheck and modify date functionality work, the problem is that the grid does not recognize this change.
There is a possibility?
Eyup
Telerik team
 answered on 07 May 2018
0 answers
98 views

Hello,

 

I found the inconsistent behavior (Focus moved at a different place) of selecting the cell in Rad grid for IE Browser.

 

As I had 15 columns displayed in my grid. So, I get horizontal scrollbar definitely.

For selecting any cell of the last column I scroll horizontally and try to select any cell.

As soon as I click on any cell the scroll reset to its default position although the cell would be selected.

 

PS. This will only happen if I had set property ## AllowKeyboardNavigation="true" ##

Smit
Top achievements
Rank 1
 asked on 07 May 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?