Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
398 views

I made a sample two-level grouping grid based on a page I am using and am filling it with sample data in the attached code. The first level grouping is sorting ascending and descending just fine. The second level grouping seems to only sort ascending successfully. The re-sort to descending is failing. I've attempted a few different ways to fix this, but they haven't been fully successful. Any help would be appreciated.

Code behind:

Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpContext     
Imports Telerik.Web.UI
Imports System.IO
 
Partial Class _TestSort
    Inherits System.Web.UI.Page
 
#Region " Variables"
    Private _dvMarksFlat As DataView = Nothing
 
#End Region
 
#Region " Control Events"
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack Then
            hdnLoadDone.Value = "N"
        End If
        If hdnLoadDone.Value <> "Y" Then
            LoadData()
            rgMarks.Rebind()
            hdnLoadDone.Value = "Y"
        End If
    End Sub
 
#End Region
     
#Region " Marks Grid"
 
    Public Function GetData_MarksTopGroup(ByRef dtMarksFlat As DataTable) As DataTable
        Dim dvMarks As DataView = dtMarksFlat.DefaultView
        Dim dtMarksTopGroup As DataTable = dvMarks.ToTable("" ,True, "SCHOOL_YEAR", "GRADE_LEVEL_CODE", "SEMESTER_TERM", "SEMESTER_TERM_Nm", _
                                                                           "ATTENDING_DISTRICT_ID_Nm", "ATTENDING_SCHOOL_ID_Nm")
        Return dtMarksTopGroup
    End Function
 
    Protected Sub rgMarks_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)
        Try
            If _dvMarksFlat isnot Nothing Then
                Dim dtMarksFlat As DataTable = _dvMarksFlat.ToTable
                Dim dtMarksTopGroup As DataTable = GetData_MarksTopGroup(dtMarksFlat)
                rgMarks.DataSource = dtMarksTopGroup
                lblNoData.Visible = False
            Else
            'No Data
                lblNoData.Visible = True
                rgMarks.Visible = False
            End If
        Catch ex As Exception
        'Hide data/controls if error
 
        End Try
 
    End Sub
 
    Protected Sub rgMarks_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs)
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        Select Case e.DetailTableView.Name
            Case "Course"
                If _dvMarksFlat isnot Nothing Then
                    Dim dtMarksFlat As DataTable = _dvMarksFlat.ToTable
 
                    Dim SCHOOL_YEAR As String = dataItem.GetDataKeyValue("SCHOOL_YEAR").ToString()
                    Dim GRADE_LEVEL_CODE As String = dataItem.GetDataKeyValue("GRADE_LEVEL_CODE").ToString()
                    Dim SEMESTER_TERM As String = dataItem.GetDataKeyValue("SEMESTER_TERM").ToString()
                    Dim ATTENDING_DISTRICT_ID_Nm As String = dataItem.GetDataKeyValue("ATTENDING_DISTRICT_ID_Nm").ToString()
                    Dim ATTENDING_SCHOOL_ID_Nm As String = dataItem.GetDataKeyValue("ATTENDING_SCHOOL_ID_Nm").ToString()
 
                    Dim dvMarksFiltered As DataView = dtMarksFlat.DefaultView
                    dvMarksFiltered.RowFilter = "SCHOOL_YEAR='" & SCHOOL_YEAR & "' AND GRADE_LEVEL_CODE='" & GRADE_LEVEL_CODE & "' AND SEMESTER_TERM='" _
                        & SEMESTER_TERM & "' AND ATTENDING_DISTRICT_ID_Nm='"& ATTENDING_DISTRICT_ID_Nm & "' AND ATTENDING_SCHOOL_ID_Nm='"& ATTENDING_SCHOOL_ID_Nm & "'"
 
                    e.DetailTableView.DataSource = dvMarksFiltered.ToTable
 
                End If
        End Select
    End Sub
 
    Private Sub rgMarks_DataBound(sender As Object, e As System.EventArgs) Handles rgMarks.DataBound
        If rgMarks.MasterTableView.Items.Count > 0 Then
            rgMarks.MasterTableView.Items(0).Expanded = True
        End If
    End Sub
 
#End Region
 
#Region " Load Data"
    Public Sub LoadData()
 
        Dim dtMarksTemp As DataTable = GetData_Marks()
        _dvMarksFlat = dtMarksTemp.DefaultView
 
    End Sub
 
    Public Function GetData_Marks(Optional ByRef blnNoData As Boolean = False) As DataTable
        Dim dtMarksFlat As New DataTable
 
        dtMarksFlat.Columns.Add("SCHOOL_YEAR", GetType(String))
        dtMarksFlat.Columns.Add("SEMESTER_TERM", GetType(String))
        dtMarksFlat.Columns.Add("SEMESTER_TERM_Nm", GetType(String))
        dtMarksFlat.Columns.Add("COURSE_CODE", GetType(String))
        dtMarksFlat.Columns.Add("COURSE_CODE_Nm", GetType(String))
        dtMarksFlat.Columns.Add("LOCAL_COURSE_CODE", GetType(String))
        dtMarksFlat.Columns.Add("COURSE_MARK", GetType(String))
        dtMarksFlat.Columns.Add("EFFORT_DESCRIPTOR", GetType(String))
        dtMarksFlat.Columns.Add("GRADE_LEVEL_CODE", GetType(String))
        dtMarksFlat.Columns.Add("CREDIT_ATTEMPTED", GetType(String))
        dtMarksFlat.Columns.Add("CREDIT_EARNED", GetType(String))
        dtMarksFlat.Columns.Add("ATTENDING_DISTRICT_ID_Nm", GetType(String))
        dtMarksFlat.Columns.Add("ATTENDING_SCHOOL_ID_Nm", GetType(String))
        dtMarksFlat.Columns.Add("COURSE_MARK_EFFORT", GetType(String))
 
 
        dtMarksFlat.Rows.Add("0910","T1","First Tri-Semester","2052","Algebra I","M3001","B","B","08",Nothing,Nothing,"Test District","Test School", "A")
        dtMarksFlat.Rows.Add("0910","T2","Second Tri-Semester","2052","Algebra I","M3002","B","B","08",Nothing,Nothing,"Test District","Test School", "B")
        dtMarksFlat.Rows.Add("0910","T3","Third Tri-Semester","2052","Algebra I","M3003","B","B","08",Nothing,Nothing,"Test District","Test School", "B")
        dtMarksFlat.Rows.Add("1011","T1","First Tri-Semester","2052","Algebra I","M3001","B","B","09",Nothing,Nothing,"Test District","Test School", "A")
        dtMarksFlat.Rows.Add("1011","T2","Second Tri-Semester","2052","Algebra I","M3002","B","B","09",Nothing,Nothing,"Test District","Test School", "B")
        dtMarksFlat.Rows.Add("1011","T3","Third Tri-Semester","2052","Algebra I","M3003","B","B","09",Nothing,Nothing,"Test District","Test School", "B")
 
        dtMarksFlat.Rows.Add("0910","T1","First Tri-Semester","6101","Spanish I","W2011","B","B","08",Nothing,Nothing,"Test District","Test School", "A")
        dtMarksFlat.Rows.Add("0910","T2","Second Tri-Semester","6101","Spanish I","W2011","B","B","08",Nothing,Nothing,"Test District","Test School", "B")
        dtMarksFlat.Rows.Add("0910","T3","Third Tri-Semester","6101","Spanish I","W2011","B","B","08",Nothing,Nothing,"Test District","Test School", "B")
        dtMarksFlat.Rows.Add("1011","T1","First Tri-Semester","6101","Spanish I","W2011","B","B","09",Nothing,Nothing,"Test District","Test School", "A")
        dtMarksFlat.Rows.Add("1011","T2","Second Tri-Semester","6101","Spanish I","W2011","B","B","09",Nothing,Nothing,"Test District","Test School", "B")
        dtMarksFlat.Rows.Add("1011","T3","Third Tri-Semester","6101","Spanish I","W2011","B","B","09",Nothing,Nothing,"Test District","Test School", "B")
 
        Return dtMarksFlat
    End Function
 
#End Region
 
End Class

Page:

<%@ Page Language="VB" AutoEventWireup="false" Inherits="myProject._TestSort" title="Student Details" Codebehind="TestSort.aspx.vb" Trace="false" ValidateRequest="false" %>
<html>
    <body >
        <form id="form1" method="post" runat="server" >
            <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"></telerik:RadFormDecorator>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" AsyncPostBackTimeout="600" />
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <style type="text/css">
                    a:hover {color: #444444; text-decoration: overline underline; background-color: #E1DDC9 !important;}
 
                    .btnDisable .rbPrimaryIcon
                    {
                        background: url(images/loading2.gif) !important;
                    }
                </style>
            </telerik:RadCodeBlock>
 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <updatedcontrols>
                            <telerik:AjaxUpdatedControl ControlID="rgMarks" />
                        </updatedcontrols>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="rgMarks">
                        <updatedcontrols>
                            <telerik:AjaxUpdatedControl ControlID="rgMarks" />
                        </updatedcontrols>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
 
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
            </telerik:RadAjaxLoadingPanel>
     
            <style type="text/css">  
                /*hide expand icon in panel*/  
                div.RadPanelBar span.rpExpandHandle
                {
                    background-image: none !important;
                }
            </style>
            <table>
                <tr>
                    <td>
                        <telerik:RadGrid runat="server" ID="rgMarks"
                            OnNeedDataSource="rgMarks_NeedDataSource" OnDetailTableDataBind="rgMarks_DetailTableDataBind" AllowMultiRowSelection="False"
                            AutoGenerateColumns="false"  AllowSorting="True" AllowPaging="true" PageSize="20" ViewStateMode="Enabled"
                            <PagerStyle Mode="NumericPages" />
                            <MasterTableView Name="Term" DataKeyNames="SCHOOL_YEAR,GRADE_LEVEL_CODE,SEMESTER_TERM,ATTENDING_DISTRICT_ID_Nm,ATTENDING_SCHOOL_ID_Nm" ClientDataKeyNames="SCHOOL_YEAR,GRADE_LEVEL_CODE,SEMESTER_TERM,ATTENDING_DISTRICT_ID_Nm,ATTENDING_SCHOOL_ID_Nm"
                                AllowMultiColumnSorting="True" HierarchyLoadMode="Client" GroupLoadMode="Client" AllowNaturalSort="false" >
 
                                <DetailTables>
                                    <telerik:GridTableView Name="Course" AllowPaging="true" PageSize="20" DataKeyNames="SCHOOL_YEAR,GRADE_LEVEL_CODE,SEMESTER_TERM,ATTENDING_DISTRICT_ID_Nm,ATTENDING_SCHOOL_ID_Nm"
                                        ClientDataKeyNames="SCHOOL_YEAR,GRADE_LEVEL_CODE,SEMESTER_TERM,ATTENDING_DISTRICT_ID_Nm,ATTENDING_SCHOOL_ID_Nm"
                                        Width="100%" AllowSorting="True" GroupLoadMode="Client" HierarchyLoadMode="Client"
                                        AllowNaturalSort="false" AllowMultiColumnSorting="True"  AllowCustomSorting="true" >
                                        <ParentTableRelation>
                                            <telerik:GridRelationFields DetailKeyField="SCHOOL_YEAR"                MasterKeyField="SCHOOL_YEAR" />
                                            <telerik:GridRelationFields DetailKeyField="GRADE_LEVEL_CODE"           MasterKeyField="GRADE_LEVEL_CODE" />
                                            <telerik:GridRelationFields DetailKeyField="SEMESTER_TERM"              MasterKeyField="SEMESTER_TERM" />
                                            <telerik:GridRelationFields DetailKeyField="ATTENDING_DISTRICT_ID_Nm"   MasterKeyField="ATTENDING_DISTRICT_ID_Nm" />
                                            <telerik:GridRelationFields DetailKeyField="ATTENDING_SCHOOL_ID_Nm"     MasterKeyField="ATTENDING_SCHOOL_ID_Nm" />
                                        </ParentTableRelation>                                                               
                                        <Columns>
                                            <telerik:GridBoundColumn UniqueName="SCHOOL_YEAR"           DataField="SCHOOL_YEAR"         SortExpression="SCHOOL_YEAR"        HeaderText="SCHOOL_YEAR"        Display="false" />
                                            <telerik:GridBoundColumn UniqueName="LOCAL_COURSE_CODE"     DataField="LOCAL_COURSE_CODE"   SortExpression="LOCAL_COURSE_CODE"  HeaderText="LOCAL_COURSE_CODE"  Display="true" />
                                            <telerik:GridBoundColumn UniqueName="COURSE_CODE"           DataField="COURSE_CODE"         SortExpression="COURSE_CODE"        HeaderText="COURSE_CODE"        Display="true" />
                                            <telerik:GridBoundColumn UniqueName="COURSE_CODE_Nm"        DataField="COURSE_CODE_Nm"      SortExpression="COURSE_CODE_Nm"     HeaderText="COURSE_CODE_Nm"     Display="true" />
                                            <telerik:GridBoundColumn UniqueName="CREDIT_ATTEMPTED"      DataField="CREDIT_ATTEMPTED"    SortExpression="CREDIT_ATTEMPTED"   HeaderText="CREDIT_ATTEMPTED"   Display="true" />
                                            <telerik:GridBoundColumn UniqueName="CREDIT_EARNED"         DataField="CREDIT_EARNED"       SortExpression="CREDIT_EARNED"      HeaderText="CREDIT_EARNED"      Display="true" />
                                            <telerik:GridBoundColumn UniqueName="COURSE_MARK_EFFORT"    DataField="COURSE_MARK_EFFORT"  SortExpression="COURSE_MARK_EFFORT" HeaderText="COURSE_MARK_EFFORT" Display="true" />
                                            <telerik:GridBoundColumn UniqueName="COURSE_MARK"           DataField="COURSE_MARK"         SortExpression="COURSE_MARK"        HeaderText="COURSE_MARK"        Display="false" />
                                            <telerik:GridBoundColumn UniqueName="EFFORT_DESCRIPTOR"     DataField="EFFORT_DESCRIPTOR"   SortExpression="EFFORT_DESCRIPTOR"  HeaderText="EFFORT_DESCRIPTOR"  Display="false" />
                                        </Columns>
                                    </telerik:GridTableView>
                                </DetailTables>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="SCHOOL_YEAR"                UniqueName="SCHOOL_YEAR"                SortExpression="SCHOOL_YEAR"                HeaderText="SCHOOL_YEAR"                Display="true" />
                                    <telerik:GridBoundColumn DataField="GRADE_LEVEL_CODE"           UniqueName="GRADE_LEVEL_CODE"           SortExpression="GRADE_LEVEL_CODE"           HeaderText="GRADE_LEVEL_CODE"           Display="true" />
                                    <telerik:GridBoundColumn DataField="SEMESTER_TERM"              UniqueName="SEMESTER_TERM"              SortExpression="SEMESTER_TERM"              HeaderText="SEMESTER_TERM"              Display="false" />
                                    <telerik:GridBoundColumn DataField="SEMESTER_TERM_Nm"           UniqueName="SEMESTER_TERM_Nm"           SortExpression="SEMESTER_TERM_Nm"           HeaderText="SEMESTER_TERM_Nm"           Display="true" />
                                    <telerik:GridBoundColumn DataField="ATTENDING_DISTRICT_ID_Nm"   UniqueName="ATTENDING_DISTRICT_ID_Nm"   SortExpression="ATTENDING_DISTRICT_ID_Nm"   HeaderText="ATTENDING_DISTRICT_ID_Nm"   Display="true" />
                                    <telerik:GridBoundColumn DataField="ATTENDING_SCHOOL_ID_Nm"     UniqueName="ATTENDING_SCHOOL_ID_Nm"     SortExpression="ATTENDING_SCHOOL_ID_Nm"     HeaderText="ATTENDING_SCHOOL_ID_Nm"     Display="true" />
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblNoData" runat="server" Text="No Data Available" Visible="false" />
                    </td>
                </tr>
            </table>
 
            <asp:HiddenField ID="hdnLoadDone" runat="server" Value="" />
 
        </form>
    </body>
</html>
Waseem
Top achievements
Rank 1
 answered on 17 Jan 2013
2 answers
121 views
The dropdown portion of combobox is overriding the textbox part in Visual Studio 2012, in browsers (tried IE and Chrome), while it is normal in Visual studio 2010
What settings need to be tweaked please

Thanks
Hamid
Hamid
Top achievements
Rank 1
 answered on 17 Jan 2013
1 answer
399 views
I'm creating a properties panel with the RadGrid, allowing the properties of a column of a different grid to be viewed/edited.

However, when I try to edit a row, I'm seeing this error:

System.ArgumentException: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
   at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
   at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
   at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I've been looking for more information and I did see this thread:  http://www.telerik.com/community/forums/aspnet-ajax/grid/telerik-radgrid-invalid-postback-or-callback-argument.aspx

I am using Advanced DataBinding, utilizing the NeedDataSource event so the solution there doesn't seem applicable.  I do have ajax enabled, utilizing the AjaxManagerProxy on the page for the grid.  At load, the NeedDataSource will bind to an empty arraylist.  If a user clicks the column of a different grid, I utilize an ajax request to populate the datasource of this grid.  I then DataBind().  This works fine.

Once I click the "edit" button on the grid row, that is when this issue arises.  The edit button is within the radgrid that's erroring but maybe due to my process it's not "the control that originally rendered" the edit button?

Below are some code snippets.  DisplayColumnProperties is what the ajax request comes back and ultimately calls.  It's not applicable to clicking the "edit" button, but it is a special case so I included it.

public void DisplayColumnProperties(string uniqueName)
{
    if (CustomReport != null && !string.IsNullOrEmpty(uniqueName))
    {
        GridColumnProperties_SetDataSource(uniqueName);
        gridColumnProperties.DataBind();
    }          
}
 
protected void GridColumnProperties_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    string columnName = (string)this.ViewState["columnName"];
    if (!string.IsNullOrEmpty(columnName))
    {
        GridColumnProperties_SetDataSource(columnName);
    } else {
        gridColumnProperties.DataSource = new ArrayList();
    }
}

GridColumnProperties_SetDataSource does not DataBind() as I think some might ask.  It builds up a view model object dictionary and sets that to the datasource as well as setting the columnName in the viewstate.

Any insight is appreciated.  Thank you.
Rob
Top achievements
Rank 1
 answered on 17 Jan 2013
1 answer
81 views
Hi,
I was able to use the autocomplete text box to filter out user entries as he types.

Here is what I want to do additionally - 

I want the same control to be used as a regular textbox - so after user selects an option from the listed matches, he should still be able to continue typing in the same text box. This additional text should not get lost after lost focus from the text box. Also, the selected option should not appear as a separate entity enclosed in an invisible frame with spaces before and after. It should just be displayed as normal text in the auto complete text box.

Is it possible to do this using the same control?
Vipul
Top achievements
Rank 1
 answered on 17 Jan 2013
1 answer
62 views
Hello,

I am new to Telerik...so, my apologies if this question is too silly... Can we use FileExplorer functionalities that we see in the demo on version 2011.1.315.35? We are trying to develop this inside of a page hosted by Sitecore Content Editor and this is the version that Sitecore uses. I cannot upgrade to the latest Telrik version without breaking Sitecore...

Thanks!
Mariella.
Vessy
Telerik team
 answered on 17 Jan 2013
1 answer
193 views
Hi guys,
I have a radgrid in my apsx page:

 

 

<telerik:RadGrid ID="FundReportGrid" runat="server" GridLines="None"

 

 

 

Skin="Office2010Blue" AllowPaging="true" AllowSorting="true"

 

 

 

onexcelmlexportrowcreated="FundReportGrid_ExcelMLExportRowCreated"

 

 

 

onexcelmlexportstylescreated="FundReportGrid_ExcelMLExportStylesCreated"

 

 

 

onneeddatasource="FundReportGrid_NeedDataSource"

 

 

 

onpageindexchanged="FundReportGrid_PageIndexChanged"

 

 

 

onpagesizechanged="FundReportGrid_PageSizeChanged"

 

 

 

onpdfexporting="FundReportGrid_PdfExporting"

 

 

 

onselectedindexchanged="FundReportGrid_SelectedIndexChanged"

 

 

 

onsortcommand="FundReportGrid_SortCommand"

 

 

 

onitemcreated="FundReportGrid_ItemCreated">

 

 

 

<ExportSettings FileName="FundingIssueReport" OpenInNewWindow="true" IgnorePaging="true" ExportOnlyData="true">

 

 

 

<Excel Format="ExcelML" FileExtension="xls" />

 

 

 

<Pdf FontType="Subset" PaperSize="Letter" />

 

 

 

</ExportSettings>

 

 

 

<MasterTableView AutoGenerateColumns="false" AllowMultiColumnSorting="true">

 

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="1px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="1px" />

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn HeaderText="Location" DataField="LOC" UniqueName="LOC" ReadOnly="true" SortExpression="LOC" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Job" DataField="JOB" UniqueName="JOB" ReadOnly="true" SortExpression="JOB" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Title" DataField="TITLE" UniqueName="TITLE" ReadOnly="true" SortExpression="TITLE" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="PD Code" DataField="PDIEM_CODE" UniqueName="PDIEM_CODE" ReadOnly="true" SortExpression="PDIEM_CODE" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Service Days" DataField="SERVICE_DAYS" UniqueName="SERVICE_DAYS" ReadOnly="true" SortExpression="SERVICE_DAYS" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 


I code behind file I am accessing data thru Store Procedure and returning Dataset:

DataSet

 

 

ds = new DataSet();

 

 

 

string jobstatus = string.Empty;

 

ds =

 

PerDiemCFNReport.CFN_Funding_Issue_Report(FiscalYear.ToString(), CFNList1.CFN, Location, JobTextBox.Text.Trim(), EMP_IDs1.SelectedID, EMP_IDs1.SelectedIDType, ref jobstatus);

 

 

 

if ((ds.Tables.Count > 0) && (ds.Tables[0].Rows.Count > 0) && (ds.Tables[0] != null))

 

{

Session[

 

"FundReportData"] = ds.Tables[0];

 

lblError.Text =

 

String.Empty;

 

lblError.Attributes.Add(

 

"display", "none");

 

FundingIssueReport.Visible =

 

true;

 

ErrorImage.Visible =

 

false;

 

BindFundIssueData();

FYDetail = CFNList1.Year;

GetDetailReport();

}

 

 

else

 

{

lblError.Visible =

 

true;

 

lblError.Text =

 

"No Data found for the given search criteria";

 

FundingIssueReport.Visible =

 

false;

 

FundingIssueDetailReport.Visible =

 

false;

 

ErrorImage.Visible =

 

true;

 

 

 

return;

 

}


This is my bind function:

private

 

 

void BindFundIssueData()

 

{

 

 

RadGrid FundIssueGrid = (RadGrid)FundingIssueReport.FindItemByValue("FundDataReport").FindControl("FundReportGrid");

 

FundIssueGrid.MasterTableView.CurrentPageIndex = 0;

FundIssueGrid.DataSource = Session[

 

"FundReportData"];

 

FundIssueGrid.DataBind();

}


For some reason only first 2 column populated with the data.I run debug and SP returns all 5 fields populated with the data.

Please help,
Thanks so much.
Kostadin
Telerik team
 answered on 17 Jan 2013
1 answer
51 views
Hi Folks - I'm having a problem with code working in VS2012, but not when I deploy to Azure, so I'm hoping someone can point me in the right direction.  I've also tried Amazon as well, with the same results.

What I'm trying to do is have a gridbutton column in a grid that when pressed, calls another page with a parameter. I've stripped down the code to that listed below, and changed the redirect link to CNN to see if that makes a difference.  The grid populates, but also paging behavior isn't normal. When the gridbutton is pressed, nothing seems to happen.

I also saw the threads regarding server time, so I've made sure I waited 24 hours after deployment before testing, with the same results, so I'm at a loss. Any help is appreciated.

Here's the sample aspx file (public URL is http://iceasppricecompare.azurewebsites.net )

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ICEAspPriceCompare.Default" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManagerMain" Runat="server">
        </telerik:RadScriptManager>
 
    <asp:SqlDataSource ID="SqlDataSourceCatalog" runat="server" ConnectionString="<%$ ConnectionStrings:icelocalmerchandiseConnectionString %>" SelectCommand="SELECT * FROM [Catalogs]"></asp:SqlDataSource>
        <telerik:RadGrid ID="RadGridMain" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="SqlDataSourceCatalog" GridLines="None" Skin="Metro" OnItemCommand="RadGridMain_ItemCommand">
<MasterTableView datakeynames="Id" datasourceid="SqlDataSourceCatalog">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MaritzCatalogId" FilterControlAltText="Filter MaritzCatalogId column" HeaderText="MaritzCatalogId" SortExpression="MaritzCatalogId" UniqueName="MaritzCatalogId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Title" FilterControlAltText="Filter Title column" HeaderText="Title" SortExpression="Title" UniqueName="Title">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Description" SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="UPC" FilterControlAltText="Filter UPC column" HeaderText="UPC" SortExpression="UPC" UniqueName="UPC">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Cost" DataType="System.Decimal" FilterControlAltText="Filter Cost column" HeaderText="Cost" SortExpression="Cost" UniqueName="Cost">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MSRP" FilterControlAltText="Filter MSRP column" HeaderText="MSRP" SortExpression="MSRP" UniqueName="MSRP">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MktAverage" DataType="System.Decimal" FilterControlAltText="Filter MktAverage column" HeaderText="MktAverage" SortExpression="MktAverage" UniqueName="MktAverage">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MktHigh" DataType="System.Decimal" FilterControlAltText="Filter MktHigh column" HeaderText="MktHigh" SortExpression="MktHigh" UniqueName="MktHigh">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MktLow" FilterControlAltText="Filter MktLow column" HeaderText="MktLow" SortExpression="MktLow" UniqueName="MktLow">
        </telerik:GridBoundColumn>
        <telerik:GridImageColumn DataImageUrlFields="ImageLink" FilterControlAltText="Filter column1 column" ImageHeight="" ImageWidth="75px" UniqueName="column1">
        </telerik:GridImageColumn>
        <telerik:GridButtonColumn CommandName="UPC" FilterControlAltText="Filter column column" Text="Market Price" UniqueName="column">
        </telerik:GridButtonColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
    </form>
</body>
</html>

 

 

 

and here's the codebehind file

using System;
using Telerik.Web.UI;
 
 
namespace ICEAspPriceCompare
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void RadGridMain_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName.Equals("UPC"))
            {
                var item = (GridDataItem)e.Item;
                string id = item.OwnerTableView.DataKeyValues[item.ItemIndex]["Id"].ToString();
                Response.Redirect("http://www.cnn.com", true);
                //Response.Redirect("GoogleSimpleLookup.aspx?Id=" + id, true);
            }
        }
    }
}
Tsvetoslav
Telerik team
 answered on 17 Jan 2013
3 answers
83 views
Hi, i have a radeditor on my page, when i set the content it gives me the follow error, anyone nows what is firing this error? Unsafe JavaScript attempt to access frame with URL chrome-extension://dknkjnkhedbanphkkpbpcgoblmkbfhlf/Js/items/container/container.html#tabUrl=http://localhost:40175 from frame with URL http://localhost:40175/Admin/Config.aspx. The frame requesting access has a protocol of 'http', the frame being accessed has a protocol of 'chrome-extension'. Protocols must match.
Rumen
Telerik team
 answered on 17 Jan 2013
3 answers
169 views
Hi,

I have the following requirement in our application and i'm using RAD Grid Q2 2009 version:
1. The records in the grid should be grouped based on say column A
2. While exporting to excel, it should export the data in new worksheet for every new group (here column A).

Item# 1 can be achieved using <GroupByFieldsoption that comes with the grid. 

While exploring options for Item# 2, i came to know from the following url, 


we can override ExcelML exporting. So i thought of using RadGrid1_ExcelMLExportRowCreated event since that would be the apt event to create a worksheet for my requirement. But i couldn't find any stuff to create worksheet dynamically! 

Please let me know is that achievable?

Thanks
Agm
Top achievements
Rank 1
 answered on 17 Jan 2013
1 answer
139 views
Hello,

We have a visual webpart that has a Radimageeditor control inside of it.  For some reason, when I try to crop an image I am seeing a JScript runtime error being thrown by ScriptResource.axd:

Microsoft JScript runtime error: Sys.ArgumentException: Cannot deserialize empty string.
Parameter name: data

I did check the http handlers in the web.config to make sure I had the correct entries. 

Can anyone assist on how to fix this issue?

Thanks! 
Vessy
Telerik team
 answered on 17 Jan 2013
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?