Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
121 views

 

hi I am trying to get a PDF Report for this following code.  But its displaying Empty Report.

Please help me .

Thanks in advance


<
telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"

 

 

GridLines="None">

 

<

 

HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>

 

<

 

MasterTableView>

 

<

 

CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>

 

<

 

RowIndicatorColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="TemplateColumn">

 

 

<ItemTemplate>

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="lblSchoolName" runat="server" Text='<%# Eval("InstitutionName") %>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Student Name

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblStudentName" runat="server" Text='<%# Eval("FullName")%>'></asp:Label>

 

 

</td>

 

 

<td>

 

Date Of Payment

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblDOP0" runat="server" Text='<%# Eval("DateOfPayment")%>'> </asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Class

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblClass" runat="server" Text='<%#Eval("CourseName")%>'></asp:Label>

 

 

</td>

 

 

<td>

 

Transaction Number

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblTransactionNumber" runat="server" Text='<%#Eval("TransactionNumber")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Year

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblYear" runat="server" Text='<%#Eval("Section")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Fee Type

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblFeeType" runat="server" Text='<%#Eval("FeeTypeName")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Term

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblTerm" runat="server" Text='<%#Eval("TermNameIndex")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

</

 

MasterTableView>

 

 

</telerik:RadGrid>

 

vijay
Top achievements
Rank 1
 answered on 31 Dec 2010
1 answer
69 views
Hi everybody and merry christmas !

I'm trying to cancel filtering client side on the "oncommand" client event.

It's Ok when i just lostfocus on the textbox filter but if i press enter key the event is not cancel.

js function :

function RadGrid1_Command(sender, eventArgs) {
 
        if (eventArgs.get_commandName() == "Sort" || eventArgs.get_commandName() == "Page" || eventArgs.get_commandName() == "PageSize" || eventArgs.get_commandName() == "Filter" ) {
            if (confirm("blablabmlablabla")) {
                eventArgs.set_cancel(true);
            }else{ ....}
        }
  }

Client setting :

<ClientSettings>
    <ClientEvents OnCommand="RadGrid1_Command" />
</ClientSettings>

Filter column :
<telerik:GridTemplateColumn HeaderText="Libellé"
                   SortExpression="LIBRED"
                   DataField="LIBRED"                            
                   AutoPostBackOnFilter="true"
                   CurrentFilterFunction="Contains"
                   ShowFilterIcon="false"
                   UniqueName="LIBRED">
                 <ItemTemplate>
                     <asp:Label ID="LibelleLbl" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "LIBRED")%>' />
                   </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks.

OPL



Daniel
Telerik team
 answered on 31 Dec 2010
1 answer
80 views
I have a clientside RadGrid that I am doing the following:
grid.tableView = grid.get_masterTableView();
grid.tableView.set_dataSource(data.Items);
grid.tableView.dataBind();
grid.tableView.set_virtualItemCount(data.Count);
Before my RowDatabound and DataBound Events are called, I am getting a bunch of blank rows with "System.Data.DataRowView" displayed in them. 
My attempt to fix this was to default the grid to display:none and then set it back later one, but I can't find a good event to do this since RowDataBound isn't good enough as it does it on the first row and that's not good enough. Any thoughts/ideas?
Tsvetoslav
Telerik team
 answered on 31 Dec 2010
8 answers
165 views
When using the GroupsDefaultExpanded = False, and also using inline editing, when I click the editbutton, my inline edit form won't show but instead the group collapses again. When using groups and not having GroupsDefaultExpanded on false there is no problem.

Using 2008.3.1124, in a dotNetNuke module. But also tried a testpage without dotnetnuke with the same problem.





G
Top achievements
Rank 1
 answered on 31 Dec 2010
1 answer
138 views
I have a case in which I need to use a custom validator in a grid edit form, and part of the custom validation is dependent upon ID of the data item being edited, but I don't see how to find that data item in my validation code.  Basically, I need to ensure that the name value entered in a text box is unique in the database for that table - which means that for an insert no other record should exist in the table with that name value, and for an update only the record with the matching ID should exist with that value.  My custom validator looks like:

<asp:CustomValidator ID="UniqueNameValidator" runat="server" Display="Dynamic"  ErrorMessage='A record already exists with this name' ControlToValidate="NameEditTextBox" OnServerValidate="ValidateUniqueName" />

Then the server side method would be:

        protected void ValidateUniqueName(object source, ServerValidateEventArgs args)
        {
            /// code here
        }

My problem is that the args object only gives me the value of the field being validated.  In order for me to do the dupe check I need to know the GridEditableItem being edited, and I don't know how to find that programmatically in this case because I don't have a GridCommandEventArgs or similar object with which to look at e.Item.

Is there any way to find the current GridEditableItem object from just looking at the grid object? Or is there another way to approach this that I am missing?
Princy
Top achievements
Rank 2
 answered on 31 Dec 2010
3 answers
215 views
I would like to validate file name when I upload document or image in RadEditor. If the file name is not valid, I would like to prompt an error message to user.

Is there any quick and easy way to do this?

I attach a screen shot to help clarify my case.
Rumen
Telerik team
 answered on 31 Dec 2010
2 answers
557 views
Dear all,

Does Telerik Grid have feature to Merge Cells? I want to Merge by Column (eg. Merge A1, A2, A3) .
If Telerik Grid doesn't have it, is there any way to do?

* My version is Q1 2010 SP2.
Hope you all can guide me as this is my first ASP.Net prj.

Thanks & Best Regards.
Naunton
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
245 views
Hi,

I need to create a grid which is very similar to the demo Grid in Hierarchy
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx

Since this for a mock up demo,  i don't have any database to point out.

I followed this example http://www.telerik.com/community/forums/aspnet-ajax/grid/show-columns-without-datasource.aspx to create a single level grid.

Could you please tel me , what is the best way to create a hierarchy grid datasource with out a database.

Need help ASAP.
Thanks.
Eva
Eva
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
53 views
Hi There,

I have a issue where I have a RadAjaxPanel and on this panel I have a Literal that holds the html from a function that creates some tables and RadTickers.
The panel is updates every 10 sec. by a timer

The first time the page is loaded and the Literal  is updated from the Page_Load event everythings works fine, but when the timer event runs after 10 sec. only tables are updated. if I look at the html that is generated it all looks fine, except the Radtikers don't start.

If I do a normal postback everything also works fine.

Do I need to update something in the ScriptManager from the Ajax event or does anyone have an idea on what could be wrong?

Thanks,

Hendrik

Hendrik Johns
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
60 views
I want to insert a record without closing the add record form.  I'm trying to use the e.Canceled = True statement but when I go to try to access the controls in the GridTemplateColumn of the RadGrid control I get errors like "Object reference not set to an instance of an object.".  Below is the code I'm using.  Any help you can provide would be appreciated.

protected void gvGrossPayroll_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.PerformInsertCommandName || e.CommandName == RadGrid.CancelCommandName)
    {
        e.Canceled = true;
 
        GridEditableItem editedItem = (sender as RadNumericTextBox).NamingContainer as GridEditableItem;
        RadNumericTextBox txtTest1 = editedItem["txtPayrollAmount1a"].Controls[0] as RadNumericTextBox;
 
        Debug.WriteLine("Test:" + Convert.ToString(txtTest1.Text));
    }
}

Here is the RadGrid that I'm trying to access the controls of:

<telerik:RadGrid ID="gvGrossPayroll" runat="server"
    AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="False"  OnInsertCommand="gvGrossPayroll_InsertCommand"
    AutoGenerateColumns="False" DataSourceID="SDS_Payroll" GridLines="None" OnItemCommand="gvGrossPayroll_ItemCommand"
    ShowFooter="True" Skin="Web20" Width="544px">
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="TopAndBottom"
        DataKeyNames="ID" DataSourceID="SDS_Payroll">
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <CommandItemSettings />
        <Columns>
            <telerik:GridBoundColumn DataField="id" ReadOnly="True" UniqueName="ID"
                Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Job Class Code" DataField="JobClass"
                UniqueName="JobClass" Visible="true" ReadOnly="False" HeaderStyle-VerticalAlign="Bottom">
                <ItemTemplate>
                    <asp:Label ID="JobClass" runat="server" Text='<%# Bind("JobClass") %>'></asp:Label>
                </ItemTemplate>
                <InsertItemTemplate>
                <telerik:RadComboBox ID="ddlJobClassID" Runat="server" AllowCustomText="True"
                    DataSourceID="SqlDataSourceDDL" DataTextField="JobClass"
                    DataValueField="JobClassID" EmptyMessage="Please enter a job class code"
                    EnableViewState="False"  AppendDataBoundItems="true"
                    ErrorMessage="You must enter a job class code to add a record"
                    MarkFirstMatch="True" ShowDropDownOnTextboxClick="False" Skin="Web20"
                    ToolTip="Enter a Job Class Code" Width="350px" SelectedValue='<%# Bind("JobClassID") %>'>
                </telerik:RadComboBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ErrorMessage="Job Class Code is a required field" Font-Bold="True"
                    Font-Names="Arial Narrow" ForeColor="Red" ControlToValidate="ddlJobClassID"
                    ToolTip="Job Class Code is a required field">X
                </asp:RequiredFieldValidator>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <asp:Label ID="JobClass" runat="server" Text='<%# Bind("JobClassID") %>'></asp:Label>
                </EditItemTemplate>                                                                         
                <HeaderStyle VerticalAlign="Bottom" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Year1"
                UniqueName="PayrollAmount1" Visible="true" Aggregate="Sum" DataField="PayrollAmount1"
                FooterAggregateFormatString="{0:C}" HeaderStyle-Width="60px">
                <ItemTemplate>
                    <asp:Label ID="PayrollAmount1" runat="server" Text='<%# Eval("PayrollAmount1", "{0:C}") %>'></asp:Label>
                </ItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount1a" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency"
                        Width="100px" Value="0" Text='<%# Bind("PayrollAmount1") %>' >
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </InsertItemTemplate>
                                                                                                 
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount1" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency"
                        Text='<%# Bind("PayrollAmount1") %>' Width="100px">
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
                <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                    Wrap="True" />
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Year2"
                UniqueName="PayrollAmount2" Visible="true" DataField="PayrollAmount2" Aggregate="Sum"
                FooterAggregateFormatString="{0:C}" HeaderStyle-Width="60px" >
                <ItemTemplate>
                    <asp:Label ID="PayrollAmount2" runat="server"
                        Text='<%# Eval("PayrollAmount2", "{0:C}") %>'></asp:Label>
                </ItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount2" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency" Value="0"
                        Width="100px" Text='<%# Bind("PayrollAmount2") %>'>
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount2" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency"
                        Width="100px" Text='<%# Bind("PayrollAmount2") %>'>
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
                <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                    Wrap="True" />
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn>
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete"
                ConfirmText="Delete this payroll record?" ImageUrl="/images/delete.gif"
                Text="Delete" UniqueName="column3">
            </telerik:GridButtonColumn>
                                                                                             
            <telerik:GridBoundColumn DataField="MemberID" DataType="System.Int16"
                UniqueName="MemberID" ReadOnly="True" Visible="False">
            </telerik:GridBoundColumn>
                                                                                             
        </Columns>
                                                                                         
        <EditFormSettings CaptionDataField="MemberID"
            CaptionFormatString="Edit Payroll Record" ColumnNumber="1"
            InsertCaption="Add Payroll Record">
            <FormTableItemStyle Wrap="False" />
            <FormCaptionStyle CssClass="EditFormHeader" />
            <FormMainTableStyle BackColor="White" CellPadding="3" CellSpacing="0"
                GridLines="None" Width="100%" />
            <FormTableStyle BackColor="White" CellPadding="2" CellSpacing="0"
                Height="110px" />
            <FormTableAlternatingItemStyle Wrap="False" />
            <EditColumn ButtonType="ImageButton" CancelText="Cancel edit"
                InsertText="Insert Record" UniqueName="EditCommandColumn1"
                UpdateText="Update record">
            </EditColumn>
            <FormTableButtonRowStyle CssClass="EditFormButtonRow" HorizontalAlign="Right" />
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="True">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Web20"
        EnableImageSprites="True">
    </HeaderContextMenu>
</telerik:RadGrid>

WCRA Dev
Top achievements
Rank 1
 answered on 30 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?