Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
79 views

I am using advanced data binding to filter, sort, and page a Telerik RadGrid. Because the DataSource is set on the NeedDataSource event, the columns and filters are generated based off the structure of the DataSource. Is there a way for the DataSource's select statement to know what columns to put the data in if I explicitly create the columns in the aspx? Right now the select adds the columns in addition to the existing ones.

aspx:

<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    AllowCustomPaging="True"
    AllowFilteringByColumn="True"
    AllowPaging="True"
    AllowSorting="True"
    OnNeedDataSource="RadGrid1_NeedDataSource"
    EnableLinqExpressions="False">
</telerik:RadGrid>

 

aspx.cs:

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) {
    //RadGrid1Select is a functioning filter/sort/page
    Select methodRadGridIsows.DataSource = RadGrid1Select();
    RadGridIsows.VirtualItemCount = count;
}

 

I am able to customize column filters by putting them directly in the aspx, however this causes there to be a repeat column because the DataSource columns will bind to it anyways. If there is no way to access the RadGrid columns on databinding, is there a way to associate certain columns in the aspx with the DataSource's DataTable when binding?

 

Marcel
Top achievements
Rank 1
 asked on 02 Feb 2018
1 answer
72 views

Hello - I see the method here that describes how to use the "Add New Record" method.  I was wondering if there was a way to customize that so the data maps below the appropriate header, instead of just a drop down table.

So it would look like this

Name    Title     Address    City   State   Zip

Test       Test     Test           Test    Test    Test

Rumen
Telerik team
 answered on 02 Feb 2018
1 answer
61 views

Can someone help me with the logic to save the column order when they are reordered?

We are using the grid for reporting and want to allow our clients to drag and drop the fields, sort them, etc. When there is a post back the order is reset. I have put in logic that works great of there is only one column that is reordered, but if there are 2 or more it doesn't work. There has to be a much easier way to save the current column order on post back?

We are using AutoGenerateColumns="true". Everything is working perfectly except moving more than one column. Please help ASAP!!

Rumen
Telerik team
 answered on 02 Feb 2018
1 answer
149 views

I'm used to searching dropdownlists like : x=  ddlInviteList.Items.IndexOf(ddlInviteList.Items.FindByValue(reader["InvitedID"].ToString()));

But I'm not seeing a similar capability in RadCheckBoxList? Also, is there a way to get the length of a RadCheckBoxList ?

 

thanks

 

david
Top achievements
Rank 1
 answered on 02 Feb 2018
1 answer
105 views

Hi,

I was trying to change the Value Cell Format like #.00 € (screenshot1.png) but it seems not working (screenshot2.png)

You can test it directly on your demo

 

Thank you

Mattia
Top achievements
Rank 2
 answered on 02 Feb 2018
1 answer
268 views

Hi,

 

I was asked to build search functionality as on thomann.de see screenshot.
I am not sure whether I should go the ComboBox or the SearchBox way.

It should search in 17.000 products.

What do you suggest?

 

Thanks for your assistance,

Marc

Vessy
Telerik team
 answered on 02 Feb 2018
5 answers
95 views

Hey All, 

 

So i have a Radgrid with a radgridcolumnbutton;

 

    <telerik:GridButtonColumn ButtonType="ImageButton" 
        FilterControlAltText="Filter PDFExport column" HeaderText="PDF" 
        ImageUrl="Icons\PDF_Export.png" CommandName="generateSamplePDF_click"  UniqueName="generateSamplePDF_click" >
    </telerik:GridButtonColumn>

 

What need this button to do is to execute the the below which creates a pdf report

 

    Protected Sub generateSamplePDF_click(ByVal sender As Object, ByVal e As ...............................)

        Dim strPath As String = ""
        Dim sampleID As String = ""
        Dim filename As String = ""

        sampleID = *****whatever text is in  column 2 of the row where the button whas selected****

' this is what is used before  sampleID = grdTests.Rows(e.CommandArgument).Cells(0).Text

    

        Dim path As String = Server.MapPath("LimsPDF") & "\" & Session("loggedCompanyID") & "\"".pdf"
        strPath = Server.MapPath("~/PDF/pdf_sample_" & sampleID & ".pdf")
        filename = "pdf_sample_" & sampleID & ".pdf"
        Report_Result_UtilityClass.generateSamplePDF(strPath, sampleID)


        Response.ContentType = "application/pdf"
        Response.AddHeader("Content-Disposition", "attachment;filename=" & filename)
        Me.EnableViewState = False
        Response.WriteFile(strPath)
        Response.Flush()
        Response.Close()

    End Sub

 

any help would be very much appreciated

Rumen
Telerik team
 answered on 02 Feb 2018
7 answers
195 views
Hello,
I have notice a problem that is not possible to add a line break <br/> before an <h1> tag when using the editor. If Press the enter key it just adds another <h1></h1>tag. How can I add line breaks  for spacing above the <h1> tag?

thank you
Rumen
Telerik team
 answered on 02 Feb 2018
6 answers
159 views
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test003.aspx.cs" Inherits="Test003" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="rsmMain"></telerik:RadScriptManager>
        <telerik:RadClientDataSource
            runat="server"
            ID="DS1"
            AllowPaging="true"
            EnableServerSorting="true"
            EnableServerFiltering="true"
            EnableServerPaging="true"
        >
        <DataSource>
            <WebServiceDataSourceSettings>
                <Select EnableCaching="false" Url="../api/test"  RequestType="Post" />
            </WebServiceDataSourceSettings>
        </DataSource>
        <Schema>
            <Model ID="Id">
                <telerik:ClientDataSourceModelField FieldName="Id" DataType="Number"  />
                <telerik:ClientDataSourceModelField FieldName="Name" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Category" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Price" DataType="Number" />
            </Model>
        </Schema>
        <ClientEvents
                OnRequestEnd="OnRequestEnd"
                OnDataParse="OnDataParse"
                OnCountRequested="OnCountRequested"
            />
    </telerik:RadClientDataSource>
    <br />
    <telerik:RadGrid runat="server" ID="rgMain"
         RenderMode="Lightweight"
         ClientDataSourceID="DS1"
         AllowMultiRowSelection ="true"
         AllowSorting="True"
         AllowPaging="True"
         PageSize="100"
         AutoGenerateColumns="false"
         AllowFilteringByColumn="true"
        >
        <MasterTableView AutoGenerateColumns="false" ClientDataKeyNames="Id" HierarchyLoadMode="Client">
            <Columns>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Id"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Category" HeaderText="Category" UniqueName="Category"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Price" HeaderText="Price" UniqueName="Price"></telerik:GridBoundColumn>
            </Columns>
            <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced" />
            <NestedViewTemplate>
                <asp:Literal runat="server" ID="Test">TEST</asp:Literal>
            </NestedViewTemplate>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnCommand="OnGridCommand" OnGridCreated="OnGridCreated" OnDataBinding="OnDataBinding" OnDataBound="OnDataBound" />
        </ClientSettings>
    </telerik:RadGrid>
    <br />
    <telerik:RadCodeBlock runat="server" ID="rcbTest">
        <script type="text/javascript">
            var gcId = "";
            var countRg = 20;
            OnRequestEnd = function (sender, args) {
                console.log('OnRequestEnd');
                //console.log(sender);
                //console.log(args);
            }
            OnDataParse = function (sender, args) {
                console.log('OnDataParse');
                var response = args.get_response();
                countRg = response.count;
                if (response) {
                    args.set_parsedData(response.Data);
                }
            }
            OnCountRequested = function (sender, args) {
                args.set_countField(countRg);
                console.log('OnCountRequested');
            }
            OnGridCommand = function(sender, args) {
                if (args.get_commandName() == "Page")
                    console.log("Page Index Changed");
                else if (args.get_commandName() == "PageSize") {
                    args.set_cancel(true);
                    if (args.get_tableView().get_pageSize() > 50) {
                        args.get_tableView().set_pageSize(50)
                        console.log("Page Size Changed BIG");
                    }
                    console.log("Page Size Changed");
                }
                else {
                    console.log('COMMAND:' + args.get_commandName());
                }
                     
            }
            OnGridCreated = function (sender, args) {
                gcId = sender.get_id();
                console.log('Grid Created');
                var mtv = sender.get_masterTableView();
                mtv.set_pageSize(20);
            }
            OnDataBinding = function (sender, args) {
                console.log('OnDataBinding');
            }
            OnDataBound = function (sender, args) {
                console.log('OnDataBound');
            }
        </script>
    </telerik:RadCodeBlock>
    </form>
</body>
</html>

 

 

Is a part of my code.
When I filtring allways ask twice. 
On start asks triple time.
When I showing Comand Panel and clikd Refresh asking four times.

 

What i Do wrong, any sugestion.

 

 

Attila Antal
Telerik team
 answered on 01 Feb 2018
0 answers
85 views
I noticed that when using Mobile Rendering in RadGrid, that the Filterlist I had create does not work.  Instead it does the generic filtering with the mobile view.  Do I take it that Filterlist is not supported in RadGrid when using Mobile rendering?
David
Top achievements
Rank 2
 asked on 01 Feb 2018
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?