Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
206 views
I have a problem with the RadInputManager control. I use a NumericTextBoxSetting control to assure that the user can only enter a decimal value in a text box.

<telerik:RadInputManager ID="imState" runat="server">
    <telerik:NumericTextBoxSetting Type="Number" MinValue="0" DecimalDigits="2">
        <TargetControls>
            <telerik:TargetInput ControlID="tbLength" />
        </TargetControls>
    </telerik:NumericTextBoxSetting>
</telerik:RadInputManager>


On the same page there's a drop down list which forces the page to carry out a postback. If the culture is for example 'de' and the user enters a double value after a postback this value becomes an integer.
for example: 4,25 -> 425

If the culture is 'en' there's no problem.

Thanks,
Gerhard
Gerhard
Top achievements
Rank 1
 answered on 27 Oct 2010
3 answers
150 views
Hi,

I am facing issues while binding the XML data to a RADTreeview.

If I use the declarative datasource and bind it to the TreeView it works, but when I specify the datasource from the codebehind, it is not able to set the Node.Value property.

Below code is working:
ASPX Code: 

<telerik:RadTreeView ID="rtvCategories" runat="server" DataSourceID="XmlDataSourceCategories" SingleExpandPath="true" onnodeclick="rtvCategories_NodeClick" >
<DataBindings>
<telerik:RadTreeNodeBinding DataMember="Node" TextField="Text" ValueField="ID" Expanded="false" />
</DataBindings>
</telerik:RadTreeView>
<asp:XmlDataSource runat="server" ID="XmlDataSourceCategories" DataFile="~/v1.xml" XPath="/Tree/Node" />

XML
<?xml version="1.0" encoding="utf-8" ?>
<!--
A Mapping xml file
  -->
- <Tree>
- <Node ID="3" Text="my category12">
  <Node ID="14" Text="disprine" />
  </Node>
- <Node ID="3" Text="my category12">
  <Node ID="25" Text="Testitem" />
  </Node>
- <Node ID="3" Text="my category12">
  <Node ID="25" Text="Testitem" />
  </Node>
- <Node ID="3" Text="my category12">
  <Node ID="25" Text="Testitem" />
  </Node>
- <Node ID="3" Text="my category12">
  <Node ID="35" Text="my Item" />
  </Node>
- <Node ID="3" Text="my category12">
  <Node ID="35" Text="my Item" />
  </Node>
- <Node ID="4" Text="Animal Category">
  <Node ID="25" Text="Testitem" />
  </Node>

  </Tree>


Code not working (the data is getting displayed but Node Value always returns blank):
<telerik:RadTreeView ID="rtvCategories" runat="server" SingleExpandPath="true" onnodeclick="rtvCategories_NodeClick" >
<DataBindings>
<telerik:RadTreeNodeBinding DataMember="Node" TextField="Text" ValueField="ID" Expanded="false" />
</DataBindings>
</telerik:RadTreeView>

protected void Page_Load(object sender, EventArgs e)
{
    string xmlData = "";

            // Below method 
getXMLCategoryItemList
 returns the same xml as string
            xmlData = objFH.getXMLCategoryItemList().ToString();

            rtvCategories.LoadXmlString(xmlData);
            rtvCategories.DataBind();
}


protected void rtvCategories_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
lblResult.Text = e.Node.Value.ToString();
}


Kindly help me in resolving the issue.

Thanks 
Ajay Sharma
Nikolay Tsenkov
Telerik team
 answered on 27 Oct 2010
2 answers
62 views
Hi,

Text Alignment property not there in RadDateTimePicker. How to right-align the text in TextBox of DateTimePicker?

Regards,
Sweety.
preethi
Top achievements
Rank 1
 answered on 27 Oct 2010
1 answer
141 views
Hi

I am having radpanelbar with multiple level and i want to change the style of panel item according to level but when i change the style it affects all the level of radpanelbar
Shinu
Top achievements
Rank 2
 answered on 27 Oct 2010
3 answers
171 views
Hi,
Could you please address the following issue.

I have been using a Telerik grid which will load data on deman, i have created one stored procedure in db which will returns
data based on grid page size,start index and max rows. But when i go to first page and select 2 records and if i click on  pag2,
so i will be loading data once again and by sending page index is 2 and page start index is 11 and max rows are 10. So if i come back to page1 then i want to select previous 2 records automatically.
so please provide me the best approach to resovle this issue.

in brief my problem is.... i want to save selections of grid rows when i load data on deman(Lazy loading)
Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 27 Oct 2010
1 answer
119 views
This is my default.aspx
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
            <telerik:RadGrid ID="RadGrid1" runat="server"
                GridLines="None">
                <MasterTableView>
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                </MasterTableView>
            </telerik:RadGrid>
     
        <telerik:RadTreeView ID="RadTreeView1" Runat="server" CheckChildNodes="True"
            CheckBoxes="True" TriStateCheckBoxes="False" EnableDragAndDrop="True"
            EnableDragAndDropBetweenNodes="True" onnodedrop="RadTreeView1_NodeDrop" MultipleSelect="true"  >
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="ThanhPho" Checkable="false"
                    AllowDrag="False">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="HCM" Checkable="False">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="HaNoi" Checkable="False">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="DaLat" Checkable="False">
                            <Nodes>
                                <telerik:RadTreeNode runat="server" Text="Ho Xuân Hương" Checkable="true">
                                </telerik:RadTreeNode>
                                <telerik:RadTreeNode runat="server" Text="Thung Lũng Tình Yêu" Checkable="true">
                                </telerik:RadTreeNode>
                            </Nodes>
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Text="Đất Nước" Checkable="false">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Việt Nam">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Singapor">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Japan">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeView>
         
    <asp:Panel ID="Panel1" runat="server" Height="256px">
    <div>
     
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <telerik:RadTextBox ID="RadTextBox1" Runat="server">
            </telerik:RadTextBox>
            <br />
         
         
    </div>
    </asp:Panel>
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" UpdatePanelHeight="" />
                    <telerik:AjaxUpdatedControl ControlID="Panel1" UpdatePanelHeight="" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    </form>
</body>

And this is my code-behind.
protected void Page_Load(object sender, EventArgs e)
        {
             
                PopulateGrid();
                RadGrid1.Rebind();
            
        }
 
        protected void RadTreeView1_NodeDrop(object sender, Telerik.Web.UI.RadTreeNodeDragDropEventArgs e)
        {
            RadTreeNode sourceNode = e.SourceDragNode;
            RadTreeNode DesNode = e.DestDragNode;
            RadTreeViewDropPosition DropPosition = e.DropPosition;
            if (DesNode != null)
            {
                 
                if (sourceNode.TreeView.SelectedNodes.Count <= 1)
                {
                    PerformDragDrop(DropPosition, sourceNode, DesNode);
                }
                else if (sourceNode.TreeView.SelectedNodes.Count > 1)
                {
                    foreach (RadTreeNode node in sourceNode.TreeView.SelectedNodes)
                    {
                        PerformDragDrop(DropPosition, node, DesNode);
                    }
                }
                DesNode.Expanded = true;
                 
                sourceNode.TreeView.UnselectAllNodes();
            }
            else if (e.HtmlElementID == "TextBox1")
            {
                
                foreach (RadTreeNode node in e.DraggedNodes)
                {
                    TextBox1.Text = node.Text;
                    RadTextBox1.Text = node.Text;
                }
                //DataTable dt = (DataTable)Session["DaTatable"];
                //foreach (RadTreeNode node in e.DraggedNodes)
                //{
                //    string[] value = { node.Text, node.Value };
                //    dt.Rows.Add(value);
                //    RadGrid1.DataSource = dt;
                //    RadGrid1.DataBind();
                //    RadGrid1.Rebind();
                //}
            }
            else if (e.HtmlElementID == RadGrid1.ClientID)
            {
               
                DataTable dt = (DataTable)Session["DaTatable"];
                foreach (RadTreeNode node in e.DraggedNodes)
                {
                    string[] value = { node.Text, node.Value };
                    dt.Rows.Add(value);
                    RadGrid1.DataSource = dt;
                    RadGrid1.DataBind();
                    RadGrid1.Rebind();
                }
            }
 
        }
        private static void PerformDragDrop(RadTreeViewDropPosition DropPosition, RadTreeNode sourceNode, RadTreeNode desNode)
        {
            switch (DropPosition)
            {
                case RadTreeViewDropPosition.Over:
                    // child
                    if (!sourceNode.IsAncestorOf(desNode))
                    {
                        sourceNode.Owner.Nodes.Remove(sourceNode);
                        desNode.Nodes.Add(sourceNode);
                    }
                    break;
                case RadTreeViewDropPosition.Above:
                    // sibling - above
                    sourceNode.Owner.Nodes.Remove(sourceNode);
                    desNode.InsertBefore(sourceNode);
                    break;
                case RadTreeViewDropPosition.Below:
                    // sibling - below
                    sourceNode.Owner.Nodes.Remove(sourceNode);
                    desNode.InsertAfter(sourceNode);
                    break;
            }
        }
        private void PopulateGrid()
        {
            string[] values = { "One", "Two" };
 
            DataTable dt = new DataTable();
            dt.Columns.Add("Item");
            dt.Columns.Add("Price");
            //dt.Columns.Add("Category");
            //dt.Rows[0]["Item"]=values[0];
            //dt.Rows[0]["Price"] = values[1];
            dt.Rows.Add(values);
            dt.Rows.Add(values);
            Session["DataTable"] = dt;
 
            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();
            RadGrid1.Rebind();
        }
When I dragged and dropped item treeview to textbox >>> It was fine. But when I dragged and dropped item treeview to radgrid >>> It didn't work . I had tested when I dragged and dropped into radgrid with a message alert >>> seem my "(e.HtmlElementID == RadGrid1.ClientID)" doesn't work because no message appeared. >>>> What 's wrong ???? Thanks a lot !!!
Nikolay Tsenkov
Telerik team
 answered on 27 Oct 2010
3 answers
150 views
Hi, I am have a point chart, and i want each point on the graph to be different,
So for example i have the following table of data

Name        Value
Company    1
Average      4
Max             5

I don't want to have a legend showing, so for each point, i need a different symbol and a the name next to each point.
Is that possible??

I have included my code below

Thanks

Simon

reports rep = new reports();
rcTechnicalDesignSpend.DataSource = rep.TestData();
rcTechnicalDesignSpend.DataGroupColumn = "Name";
rcTechnicalDesignSpend.PlotArea.XAxis.DataLabelsColumn = "Value";
rcTechnicalDesignSpend.PlotArea.YAxis.MaxValue = 0;
rcTechnicalDesignSpend.Legend.Appearance.GroupNameFormat = "#VALUE";
rcTechnicalDesignSpend.DataBind();
<telerik:RadChart ID="rcTechnicalDesignSpend" runat="server" DefaultType="Point" 
        BorderWidth="0" SeriesOrientation="Horizontal" Skin="Blue" 
        EnableTheming="False" Height="25px">
        <Series>
        <telerik:ChartSeries Appearance-ShowLabelConnectors="True" /> </Series>
        <Appearance>
            <Border Visible="False" />
        </Appearance>
         
        <Legend Visible="False">
            <Appearance Visible="False">
                <ItemTextAppearance TextProperties-Color="DimGray">
                </ItemTextAppearance>
                <Border Color="DimGray" />
            </Appearance>
            <Marker Visible="False">
            </Marker>
        </Legend>
        <PlotArea>
          
            <XAxis Visible="False">
                <Appearance>
                    <MajorGridLines Color="DimGray" Width="0" />
                </Appearance>
                <AxisLabel>
                    <Appearance RotationAngle="270">
                    </Appearance>
                    <TextBlock>
                        <Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">
                        </Appearance>
                    </TextBlock>
                </AxisLabel>
            </XAxis>
            <YAxis Visible="True">
                <ScaleBreaks Enabled="True">
                    <Segments>
                        <telerik:AxisSegment MaxValue="108" MinValue="20" Name="" Step="8" />
                        <telerik:AxisSegment MaxValue="4" Name="" Step="2" />
                    </Segments>
                </ScaleBreaks>
                <Appearance EndCap="Square" MajorTick-Visible="False" MinorTick-Visible="False" 
                    StartCap="Square" Width="3" >
                    <MajorGridLines Color="DimGray" Visible="False" />
                    <MinorGridLines Visible="False" />
                    <LabelAppearance Visible="False">
                    </LabelAppearance>
                </Appearance>
                <AxisLabel>
                    <Appearance RotationAngle="0">
                    </Appearance>
                    <TextBlock>
                        <Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">
                        </Appearance>
                    </TextBlock>
                </AxisLabel>
            </YAxis>
            <YAxis2>
                <AxisLabel>
                    <Appearance RotationAngle="0">
                    </Appearance>
                    <TextBlock>
                        <Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">
                        </Appearance>
                    </TextBlock>
                </AxisLabel>
            </YAxis2>
            <Appearance Corners="Round, Round, Round, Round, 6">
                <FillStyle FillType="Solid" MainColor="White">
                </FillStyle>
                <Border Color="DimGray" Visible="False" />
            </Appearance>
        </PlotArea>
        <ChartTitle Visible="False">
            <Appearance Visible="False" Corners="Round, Round, Round, Round, 6" 
                Dimensions-Margins="4%, 10px, 14px, 0%" Position-AlignedPosition="Top">
                <FillStyle GammaCorrection="False" MainColor="224, 224, 224">
                </FillStyle>
                <Border Color="DimGray" />
            </Appearance>
            <TextBlock>
                <Appearance TextProperties-Font="Verdana, 11.25pt">
                </Appearance>
            </TextBlock>
        </ChartTitle>
    </telerik:RadChart>
Ves
Telerik team
 answered on 27 Oct 2010
1 answer
52 views
Hi
Issue1:
I am creating self hierarchy grid by using a list it's working fine,but when am generating same with data table it is throwing exception
No property or field '' exists in type 'DataRowView'.

In this scenario if i set EnableLinqExpressions="false" it is working fine,but it grid displaying parent and child hierarchy , problem is it is displaying child rows at parent level as well(two sets of child records one like parent-child relationship and second child records as normal records at parent level)

Issue2:

When I am creating self hierarchy grid with dynamic template columns(template columns are generated programatically )
not able to get hierarchy.

can anybody please suggest me..what is the problem.

Thanks in advance.
Pavlina
Telerik team
 answered on 27 Oct 2010
3 answers
139 views

Hi , 
i am using radgrid multiple grid export functionality but while click on export button i am getting below error..

RadGrid must be databound before exporting.


my grid is below...

 <div>
                
               <telerik:RadGrid ID="RadGridWrapper" runat="server" Width="550px"
            BorderStyle="None" >
            <ExportSettings OpenInNewWindow="true" />
            <MasterTableView AutoGenerateColumns="true" BorderStyle="None">
                <ItemTemplate>
                    <telerik:RadGrid ShowGroupPanel="true" AutoGenerateColumns="false" ID="grdEURPlanning"
        DataSourceID="EURPlanningDataSource"  AllowSorting="True" Width="130px"
        ShowFooter="True" runat="server" EnableLinqExpressions="false" Skin="Office2007" GridLines="Horizontal" OnPreRender="grdEURPlanning_PreRender">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true"
           TableLayout="Fixed" AlternatingItemStyle-BackColor="#F2F3F5" HeaderStyle-Font-Bold="true">
                        
            <Columns>
            
                       <telerik:GridBoundColumn
                                            DataField="FinancialAccountGroupText"
                                            Visible="true"
                                            HeaderText="Category"
                                            FooterText="Total"
                                            FooterStyle-Font-Bold ="true"
                                            FooterStyle-HorizontalAlign ="Left"  
                                            HeaderStyle-Width="50px"                                           
                                        >
                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn
                                            DataField="Estimation"
                                            Visible="true"
                                            HeaderText="Estimation"
                                            DataFormatString="€{0:### ###.00}"
                                            ItemStyle-HorizontalAlign = "Right"
                                            HeaderStyle-HorizontalAlign = "Right"
                                            Aggregate = "Sum"
                                            FooterStyle-Font-Bold ="true"
                                            FooterStyle-HorizontalAlign ="Right"
                                            HeaderStyle-Width="50px"
                                        >
                                        </telerik:GridBoundColumn>
                            
                    </Columns>
                    
                       
            
                </MasterTableView>

                <ClientSettings EnableAlternatingItems="true"
                                EnableRowHoverStyle="true"
                            >
                <Selecting AllowRowSelect="True" />
                </ClientSettings>                

            </telerik:RadGrid>
                    <br />
                   <telerik:RadGrid ShowGroupPanel="true" AutoGenerateColumns="false" ID="grdEURAllocation"
        DataSourceID="EURAllocationDataSource"  AllowSorting="True" Width="390px"
        ShowFooter="True" runat="server" EnableLinqExpressions="false" Skin="Office2007" GridLines="Horizontal">
        <PagerStyle Mode="NextPrevAndNumeric" />
        
        
        <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" TableLayout="Fixed"
            AlternatingItemStyle-BackColor="#F2F3F5" HeaderStyle-Font-Bold="true">
                        
            <Columns>
                        <telerik:GridBoundColumn DataField="DestinationFund" HeaderText="Fund" SortExpression="DestinationFund"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"
                            UniqueName="DestinationFund"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="30px"
                            />
                        <telerik:GridBoundColumn DataField="DestUserProj" HeaderText="User Proj" SortExpression="DestUserProj"
                            UniqueName="DestUserProj" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                            HeaderStyle-Width="50px"
                             />
                        <telerik:GridHyperLinkColumn DataTextField="CostCentre" HeaderText="Cost Centre" SortExpression="CostCentre"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"
                            UniqueName="CostCentre"
                            DataNavigateUrlFields="Id"
                            DataNavigateUrlFormatString="~/Allotment/Allotment.aspx?allotmentId={0}&ViewMode=ReadOnly"
                            Target="_blank"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="50px"
                            />
                        <telerik:GridBoundColumn DataField="AllotmentDate" HeaderText="Date" SortExpression="AllotmentDate"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="AllotmentDate"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="60px"
                            />
                        <telerik:GridBoundColumn DataField="PlannedAmountInt" HeaderText="Amount" SortExpression="PlannedAmountInt"
                            Aggregate="Sum"
                            DataFormatString="€{0:### ### ### ###.00}"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="PlannedAmountInt"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="60px"
                            />
                            
                    </Columns>               
           
            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="Fund" />
                    </GroupByFields>
                    <SelectFields>
                        <telerik:GridGroupByField FieldName="Fund" HeaderText="Fund" />
                    </SelectFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>
            
        </MasterTableView>
        <ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <GroupingSettings ShowUnGroupButton="true" />
    </telerik:RadGrid>
                    <br />
                   <telerik:RadGrid ShowGroupPanel="true" AutoGenerateColumns="false" ID="grdEURExpenditures"
        DataSourceID="EURExpendituresDataSource"  AllowSorting="True" Width="600px"
        ShowFooter="True" runat="server" EnableLinqExpressions="false" Skin="Office2007" GridLines="Horizontal">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true"
           TableLayout="Fixed" AlternatingItemStyle-BackColor="#F2F3F5" HeaderStyle-Font-Bold="true">
                        
            <Columns>
              
                        <telerik:GridBoundColumn DataField="Fund" HeaderText="Fund" SortExpression="Fund"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"
                            UniqueName="Fund"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="25px"
                            />
                        <telerik:GridBoundColumn DataField="Account" HeaderText="Account" SortExpression="Account"
                            UniqueName="Account" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                             HeaderStyle-Width="35px" />
                        <telerik:GridBoundColumn DataField="UserProj" HeaderText="User Proj" SortExpression="UserProj"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"
                            UniqueName="UserProj"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="50px"
                            />
                        <telerik:GridBoundColumn DataField="CostCentre" HeaderText="Cost Centre" SortExpression="CostCentre"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="CostCentre"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="50px"
                            />
                        <telerik:GridBoundColumn DataField="Unliquidated" HeaderText="Unliquidated" SortExpression="Unliquidated"
                            Aggregate="Sum"
                            DataFormatString="€{0:### ### ### ###.00}"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="Unliquidated"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right"
                            HeaderStyle-Width="60px"
                            />
                            <telerik:GridBoundColumn DataField="Disbursement" HeaderText="Disbursement" SortExpression="Disbursement"
                            Aggregate="Sum"
                            DataFormatString="€{0:### ### ### ###.00}"
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="Disbursement"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="65px"
                            />
                            <telerik:GridBoundColumn DataField="ExtRef" HeaderText="ExtRef" SortExpression="ExtRef"
                            
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="ExtRef"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="60px"
                            />
                             <telerik:GridBoundColumn DataField="ExpDate" HeaderText="Exp Date" SortExpression="ExpDate"
                            
                            FooterStyle-Font-Bold ="true"
                            FooterStyle-HorizontalAlign ="Right"                            
                            UniqueName="ExpDate"
                            HeaderStyle-HorizontalAlign="Right"
                            ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="60px"
                            />
                            
                    </Columns>
                    
                     <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="Fund" />
                    </GroupByFields>
                    <SelectFields>
                        <telerik:GridGroupByField FieldName="Fund" HeaderText="Fund" />
                    </SelectFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>
            
                </MasterTableView>
                
        <ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <GroupingSettings ShowUnGroupButton="true" />
                
            </telerik:RadGrid>
                </ItemTemplate>
            </MasterTableView>
        </telerik:RadGrid>
           </div>


protected void btnExportWord_Click(object sender, EventArgs e)
    {
         RadGridWrapper.MasterTableView.ExportToWord();
}

this approach i used from the  below reply...

You can try the following approach:
Export multiple RadGrids in single PDF/Excel file

Regards,
Daniel
the Telerik team



My req. is that on my page i have 3 radgrid and all different grid having no relation with each other and i want to export the data of all 3 grids into one word file.

Please help.

waiting for your reply.



Daniel
Telerik team
 answered on 27 Oct 2010
1 answer
138 views
Hello,
i use a RadGrid in a UpdatePanel. The cells contain ImageButtons.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>        
            <telerik:RadGrid ID="RadGrid1" runat="server" Width="900px" Height="400px" 
                Skin="Office2007"  
                onitemdatabound="RadGrid1_ItemDataBound" 
                onitemcommand="RadGrid1_ItemCommand" GridLines="None" >
                <ClientSettings>
                    <Scrolling AllowScroll="true" UseStaticHeaders="true"   FrozenColumnsCount="1" SaveScrollPosition="true"/> 
                </ClientSettings
                <MasterTableView TableLayout="Auto" />
                <HeaderStyle Width="100px" />                              
            </telerik:RadGrid>        
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="RadGrid1" EventName="ItemCommand" />
        </Triggers>
</asp:UpdatePanel>

Code:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
          
        GridDataItem item = (GridDataItem)e.Item;
  
        Label lbl = new Label();
        lbl.Text = item[""].Text.Substring(item[""].Text.IndexOf("|") + 1);
        item[""].Controls.Add(lbl);
  
        for (int i = 0; i < gruppenliste.Count; i++)
        {
            ImageButton imgbtn = new ImageButton();
  
            if (item[gruppenliste[i].ToString()].Text.StartsWith("0"))
            {
                imgbtn.CommandName = "add";
                imgbtn.ImageUrl = "../img/cancel.gif";
                item[gruppenliste[i].ToString()].Controls.Add(imgbtn);
                item[gruppenliste[i].ToString()].HorizontalAlign = HorizontalAlign.Center;
                imgbtn.CommandArgument = item[""].Text.Substring(
                    0, item[""].Text.IndexOf("|")) +
                    "|" +
                    item[gruppenliste[i].ToString()].Text.Substring(
                    item[gruppenliste[i].ToString()].Text.IndexOf("|") + 1);
            }
            else
            {
  
                imgbtn.CommandName = "del";
                imgbtn.ImageUrl = "../img/ok.gif";
                item[gruppenliste[i].ToString()].Controls.Add(imgbtn);
                item[gruppenliste[i].ToString()].HorizontalAlign = HorizontalAlign.Center;
                imgbtn.CommandArgument = item[""].Text.Substring(
                    0, item[""].Text.IndexOf("|")) +
                    "|" +
                    item[gruppenliste[i].ToString()].Text.Substring(
                    item[gruppenliste[i].ToString()].Text.IndexOf("|") + 1);
            }
        }
    }
}

When I click a ImageButton, then the grid in the UpdatePanel is refreshed.
How can I automatically scroll back to the current row/column (ImageButton) after the refresh?

Reiner
Veli
Telerik team
 answered on 27 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?