Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
210 views
Hi. I have a radGrid with several columns. Some of them are comboboxes and two are RadTextBox. When user type something and press enter it processes the filter and when user clear the TextBox and press enter it clear the filter.
I am using the fuction below which was provided by Telerik.
function TitleKey(event, sender) {
     if (event.keyCode == 13) {
              var filterValue = "";
              var filterFunction = "NoFilter";
              var s = sender.value;
              if (s != "") {
                  filterValue = s;
                  var filterFunction = "Contains";
              }
     var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
     tableView.filter("title", filterValue, filterFunction);
     }
}
However everytime I clear the filter and press enter two steps occur. First it brings the grid as first loaded without any filter, than it brings the right grid with the right result if one or more filter are on.
I have tried to debug it and I cannot find why it is bringing a full grid as first Step.
The other thing is the AjaxPanal does not work properly for this textbox filter compared with the combobox. In the combobox the loading icon is on all post back process. With txtbox you rarely notice it on but when it is gone the application is still processing the grid.
Viktor Tachev
Telerik team
 answered on 18 Mar 2014
9 answers
683 views
How do i add autonumber to the RadGrid.
i can do in grid like this
<asp:TemplateField SortExpression="displayedname">
                    <HeaderTemplate>
                        Rec #</HeaderTemplate>
                    <ItemTemplate>
                        <%#Container.DataItemIndex+1%></ItemTemplate>
                </asp:TemplateField>

how do i add in radgrid.
Mohamad
Top achievements
Rank 1
 answered on 18 Mar 2014
2 answers
509 views
Hi,
I can get any data with the client template and it works fine, but i cannot find a way to round a 'Double' value as math round or in string.Format("C0")
in the client template. I want to round the dataItem.QuoteSumDollars which is a 'Double' with no decimal digits.
Here is my HtmlChart Series:

                           <Series>
                            <telerik:LineSeries Name="Quote" DataFieldY="QuoteSumDollars">
                                <LabelsAppearance>
                                    <ClientTemplate>
                                         #=dataItem.QuoteSumDollars#
                                    </ClientTemplate>
                                </LabelsAppearance>
                                <TooltipsAppearance>
                                    <ClientTemplate>
                                        Quote #=dataItem.QuoteID#
                                    </ClientTemplate>
                                </TooltipsAppearance>
                            </telerik:LineSeries>
                        </Series>

Many thanks.
Yaniv
Top achievements
Rank 1
 answered on 18 Mar 2014
4 answers
527 views
HI,
     Currently i am using a radgrid control in our application. I have enabled client side column reorder "true". after that i am saving the preference in database , so that when the user revisit the page it will maintain the column order from database.
The issue i am facing is, it is storing same order index for two columns, can any one help me how i will get unique order index for each column.

my code:
 foreach (GridColumn col in RadGridSearch.MasterTableView.Columns)
                {
                    if (col.UniqueName == "Status" || col.UniqueName == "Deletecolumn" ||
                        col.UniqueName == "GridEditColumn" || col.UniqueName == "DetailView" ||
                        col.UniqueName == "ContactDetails" || col.UniqueName == "ActiveFlag1")
                        continue;
                    else
                    {
                        Int64 UserProfileFieldID = 0, UserProfileID = 0;
                        int SortType = 0, SortSequence = 0;

                        DataRow dr;
                        dr = configData.Tables["UserProfileFields"].NewRow();
                        dr[0] = Convert.ToInt32(col.UniqueName.Split('-')[1]); // Field Number

                        GetFieldValues(GetColumnName(col), Convert.ToInt32(col.UniqueName.Split('-')[1]),
                                ref SortType, ref SortSequence, ref UserProfileFieldID, ref UserProfileID);

                        dr[1] = SortType; // Sorting Type
                        dr[2] = SortSequence; // Sorting Sequence
                        dr[3] = col.OrderIndex; // Column Index
                        dr[4] = col.HeaderStyle.Width.Value;  // Column Size

                        dr[5] = col.EvaluateFilterExpression().ToString(); // Filter exp
                        if (!string.IsNullOrEmpty(col.EvaluateFilterExpression()))
                        {
                            filterSeq = filterSeq + 1;
                            dr[6] = filterSeq;
                        }
                        else
                            dr[6] = 0;

                        dr[7] = col.Display; // Show in UI

                        if (objSearchView.Session["UserPreference"] != null)
                        {

                            dr[8] = UserProfileFieldID; // UserProfileFieldID
                            dr[9] = UserProfileID;  // UserProfileID
                        }
                        configData.Tables["UserProfileFields"].Rows.Add(dr);
                        temp++;
                    }
                }

                AddUserProfileDetail(IdentifierType, objSearchView.Session["UserDescription"] as string, "CustomerSearch", "RadGridSearch", RadGridSearch.MasterTableView.PageSize, RadGridSearch.MasterTableView.FilterExpression, configData);
                //ScriptManager.RegisterStartupScript(objSearchView.Page, objSearchView.GetType(), "alertMessage", "alert('User Preference Saved Successfully')", true);
                //LoadCustomerColumns();
            }
}

Thanks In advance.
Kostadin
Telerik team
 answered on 18 Mar 2014
1 answer
88 views
I'm upgrading from Telerik 2008 to the latest version, however it looks like the css classes are rather different.

I have sorted most of it out, however I still have one odd issue on the header.

When hovering over the column header the whole background of the header should go lighter, however in the area where the text is that is not the case. Also when I hover over the text, the text changes color, but I did not set that up that way.

Any help would be very much appriciated.
Venelin
Telerik team
 answered on 18 Mar 2014
1 answer
67 views
Hello guys,

i'm having problem with gridtempletecolumn, when i add boundcolums the data shown properly but when i use templetecolum it does not show the data, can any one solve my problem.
Pavlina
Telerik team
 answered on 18 Mar 2014
1 answer
58 views
Hi,
      I want to print a grid data, I am Using browser IE9.
When i print a grid data after printed data not display well on paper just like as  Grid  Column Header are not shown, scroll shown, all column data not shown.
please find the attach and provide solutions.

And My grid code is:
<asp:UpdatePanel ID="update_lease__report" runat="server">
<ContentTemplate>
        <telerik:RadGrid CssClass="MyGrid"  ID="gv_Lease_Report" runat="server"                                                 AllowFilteringByColumn="True" AllowSorting="True"   ShowGroupPanel="True" AutoGenerateColumns="False"  PageSize="10"    ShowStatusBar="true" onneeddatasource="gv_Lease_Report_NeedDataSource"  OnItemCreated="gv_Lease_Report_ItemCreated"                                            OnHTMLExporting="gv_Lease_Report_HtmlExporting"           onexcelexportcellformatting="gv_Lease_Report_ExcelExportCellFormatting" >
     <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
             <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
                  BorderStyle="Medium" BorderColor="#666666" PaperSize="A4" >
    </Pdf>                                                       
    </ExportSettings>
     <ClientSettings AllowDragToGroup="True" >
                  <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"  />       </ClientSettings>
       <MasterTableView  AutoGenerateColumns="false">
                  <FilterItemStyle HorizontalAlign="Left" />
                          <NoRecordsTemplate>
                                 <asp:Label ID="lbl_no_record" runat="server" Text="No record exist"></asp:Label>
                          </NoRecordsTemplate>
          <Columns>                                                                   
                 <telerik:GridBoundColumn  Display="false" DataField="UnitContractId" DataType="System.String" HeaderText="Unit Contract Id" FilterControlAltText="Filter column column" UniqueName="UnitContractId" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">                                                                                                                                                                                </telerik:GridBoundColumn>
    <telerik:GridBoundColumn  DataField="ParcelName" DataType="System.String" HeaderText="Parcel Name" FilterControlAltText="Filter column column" UniqueName="ParcelName" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >                                                                                                                                 
   </telerik:GridBoundColumn>                                                          
         <telerik:GridBoundColumn  DataField="UnitNo" DataType="System.String" HeaderText="Unit Number" FilterControlAltText="Filter column column" UniqueName="UnitNo" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >
  </telerik:GridBoundColumn>
       <telerik:GridBoundColumn  DataField="TenentName" DataType="System.String" HeaderText="Tenent Name" FilterControlAltText="Filter column column" UniqueName="TenentName" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >                                                                                                                                 
     </telerik:GridBoundColumn>                                                                      
          <telerik:GridDateTimeColumn DataField="ContractStartDate" HeaderText="Contract Start Date"  FilterControlAltText="Filter column column" UniqueName="ContractStartDate" PickerType="DatePicker" FilterDateFormat="dd/MM/yyyy" DataFormatString="{0:dd/MM/yyyy}"   ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" > </telerik:GridDateTimeColumn>     
     <telerik:GridDateTimeColumn DataField="ContractEndDate" HeaderText="Contract End Date" FilterControlAltText="Filter column column" UniqueName="ContractEndDate" PickerType="DatePicker" FilterDateFormat="dd/MM/yyyy" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"></telerik:GridDateTimeColumn>                                                              
          <telerik:GridBoundColumn  DataField="ContractAmount" DataType="System.Decimal" HeaderText="Contract Amount" FilterControlAltText="Filter column column" UniqueName="ContractAmount" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >                                                                                                                                 
           </telerik:GridBoundColumn>
   </Columns>
 </MasterTableView>                                                    
    </telerik:RadGrid>
          </ContentTemplate>                                             
    </asp:UpdatePanel>
Kostadin
Telerik team
 answered on 18 Mar 2014
1 answer
102 views
Hello All,

I have using a RadFileExplorer for uploading a images/docs . So when i click on the upload toolbar and then uploaded a images from that after i images uploadingh the toolbar became disabled like the attach files.Please Provide me the solution for this problem . it is urgent  for me
Vessy
Telerik team
 answered on 18 Mar 2014
1 answer
70 views
For my internship I have to work with Telerik which is going great since the forums is up to date and I can find many tutorials.
I started to combine tricks etc for the better effect.

For the project I have to do, I have to change the values in a dropdownlist whenever the values of the other dropdownlist is changed.
Not that difficult normally.

However I am trying to do this when both dropdownlists are in the editmode(batch) of a radgrid, which is in a radpanel. I can't figure out how to acces the changeselectedvalue event

Now my question is, is it possible to trigger this event while the dropdownlists is in a Radgrid in editmode batch?
In the first attachment is a part of my code with both the columns selected.
In the second is how my page looks right now (all data from 'Eenheid'). I wanna change the databound of 'Eenheid' whenever I change the value of 'Vector'

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="MultipleExpandedItems"
                    Width="80%">
                    <Items>
                         <telerik:RadPanelItem Expanded="True" Text="Verbruik" runat="server"
                              Selected="true">
                              <Items>
                                   <telerik:RadPanelItem Value="Verbruik" runat="server">
                                        <ItemTemplate>
                                            <div>
                                                <!--radgrid + datasource Verbruik-->
                                                <div id="radgridVerbruik">
                                                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
                                                        <telerik:RadGrid ID="RadGridVerbruik" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                                                            AllowAutomaticUpdates="True" AutoGenerateColumns="False" DataSourceID="SqlDataSourceInstallatieJaarVectorVerbruik">
                                                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSourceInstallatieJaarVectorVerbruik"
                                                                EditMode="Batch" CommandItemDisplay="Top" CommandItemSettings-ShowSaveChangesButton="false"
                                                                CommandItemSettings-AddNewRecordText="Nieuwe vector" CommandItemSettings-CancelChangesText="Annuleer">
                                                                <BatchEditingSettings EditType="Row" />
                                                                <Columns>
                                                                    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" HeaderText="ID"
                                                                        ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="false">
                                                                    </telerik:GridBoundColumn>
                                                                     
                                                                    <telerik:GridTemplateColumn DataField="vectorID" FilterControlAltText="Filter Vector column"
                                                                        HeaderText="Vector" SortExpression="Vector" UniqueName="vectorID">
                                                                        <ItemTemplate>
                                                                            <%# Eval("Vector") %>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <telerik:RadDropDownList ID="RadDropDownList2" runat="server" DataSourceID="SqlDataSourceVectorenVerbruik"
                                                                                DataTextField="omschrijving" DataValueField="vectorID">
                                                                            </telerik:RadDropDownList>
                                                                        </EditItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn DataField="eenheidID" FilterControlAltText="Filter Eenheid column"
                                                                        HeaderText="Eenheid" SortExpression="Eenheid" UniqueName="eenheidID">
                                                                        <ItemTemplate>
                                                                            <%# Eval("Eenheid") %>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <telerik:RadDropDownList ID="RadDropDownList3" runat="server" DataSourceID="SqlDataSourceEenheden"
                                                                                DataTextField="omschrijving" DataValueField="eenheidID">
                                                                            </telerik:RadDropDownList>
                                                                        </EditItemTemplate>
                                                                    </telerik:GridTemplateColumn>
Angel Petrov
Telerik team
 answered on 18 Mar 2014
1 answer
184 views
For my internship I have to work with Telerik which is going great since the forums is up to date and I can find many tutorials.
I started to combine tricks etc for the better effect.

For the project I have to do, I have to change the values in a dropdownlist whenever the values of the other dropdownlist is changed.
Not that difficult normally.

However I am trying to do this when both dropdownlists are in the editmode(batch) of a radgrid, which is in a radpanel. I can't figure out how to acces the changeselectedvalue event

Now my question is, is it possible to trigger this event while the dropdownlists is in a Radgrid in editmode batch?
In the first attachment is a part of my code with both the columns selected.
In the second is how my page looks right now (all data from 'Eenheid'). I wanna change the databound of 'Eenheid' whenever I change the value of 'Vector'


Jeffrey
Angel Petrov
Telerik team
 answered on 18 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?