Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
82 views
Hi everyone, 

I'm using a Radgrid to show some information... One of the features i've decided to set is the Export to Excel.

Everything works fine, except for some fields that are Guids.... Those values for the guids don't are exported to the file.

Any help would be very appreciated.
antao
Top achievements
Rank 1
 asked on 11 Jul 2012
3 answers
1.7K+ views
Hi
I am using radgrid 5.1.2
I am sure this is an obvious question but I can't find it in the documentation. How do i find the row index of the grid in the item data bound event
thanks
Princy
Top achievements
Rank 2
 answered on 11 Jul 2012
3 answers
91 views
I have a radGrid and am trying to get the ItemCommand buttons working. When the item command button is clicked the ItemCommand event filres and I can see here that the grid has 4 items (rgdGrid.Items.Count = 4). But when the page pre render event fires the items have been lost (rgdGrid.Items.Count = 0).

I bind data programatically then the grid is first shown and do not need to do it again. Viewstate is enabled for this grid control.

Any ideas?
------------------------------------------

protected

 

void rgdGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 

protected

 

override void OnPreRender(EventArgs e)
------------------------------------------

 

<

 

telerik:RadGrid ID="rgdGrid" runat="server" AutoGenerateColumns="False" Culture="en-GB"

 

 

 

 

 

ShowStatusBar="True" ShowFooter="False" OnUpdateCommand="rgdGrid_UpdateCommand"

 

 

 

 

 

OnEditCommand="rgdGrid_EditCommand"

 

 

OnItemDataBound="rgdGrid_ItemDataBound" OnCancelCommand="rgdGrid_CancelCommand"

 

 

 

 

 

AllowSorting="True" GroupingEnabled="False" OnSortCommand="rgdGrid_SortCommand"

 

 

 

 

 

Width="100%" ShowGroupPanel="True" Skin="Web20" MasterTableView-CellPadding="0"

 

 

 

 

 

MasterTableView-CellSpacing="0" CellPadding="0"

 

 

onitemcommand="rgdGrid_ItemCommand">

 

 

 

 

 

<MasterTableView EnableHeaderContextMenu="true" EditMode="InPlace" ItemStyle-Wrap="False"

 

 

 

 

 

CommandItemDisplay="TopAndBottom" >

 

 

 

 

 

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">

 

 

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">

 

 

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

<Columns>

 

-----------------------------------------------------

<

 

CommandItemTemplate>

 

 

<p style="text-align: right;">

 

 

<asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditAll" Visible="True"

 

 

Text="Edit" />

 

 

<asp:LinkButton ID="btnUpdate" runat="server" CommandName="UpdateAll" Visible="True"

 

 

Text="Update" />

 

 

</p>

 

 

</CommandItemTemplate>

 

Shinu
Top achievements
Rank 2
 answered on 11 Jul 2012
2 answers
340 views
Hi all, i have a problem with RadGrid.

When i enter into a page where there is a RadGrid, i want that RadGrid Insert Form is opened.

I have looked for on the forum but i didint find any solution for my problem.

I tryed what you suggested in the following forum

http://www.telerik.com/community/forums/aspnet/grid/i-want-call-radgrid1-insertcommand-from-a-button-out-of-rad-grid.aspx#484224

but my case is a bit different.


I have tryed to call

radgrid1.Items[0].FireCommandEvent("InitInsert", string.Empty)

in Page_Load and this works if i have at least 1 item. If my RadGrid is empty, it fires and exception because the radgrid1.Items[0] doesn't exist. Can you give me a little advice?

Many thank
Alessandro
Alessandro
Top achievements
Rank 1
 answered on 11 Jul 2012
1 answer
199 views
I'm getting this error constantly:

http://i.imgur.com/CYPdu.jpg 

This happens when I click in a RadButton that fires a RadAlert using this:

DirectCast(Me.Page.FindControl("WindowManager"), RadWindowManager).RadAlert("Endereço foi salvo com sucesso.", 330, 100, "Sucesso", "alertCallBackFn")

My WindowManager is:

<telerik:RadWindowManager ID="WindowManager" runat="server" EnableShadow="true" EnableViewState="false" ReloadOnShow="true">
    <ConfirmTemplate>
        <div class="rwDialogPopup radconfirm">
            <div class="rwDialogText">
                {1}
            </div>
            <div>
                <a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">Sim</span></span></a> <a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);"><span class="rwOuterSpan"><span class="rwInnerSpan">Não</span></span></a>
            </div>
        </div>
    </ConfirmTemplate>
</telerik:RadWindowManager>

And my callback function It's:

<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
    <script language="javascript" type="text/javascript">
 
        function alertCallBackFn(arg) {
            CloseRadWindow();
        }
 
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
 
        function CloseRadWindow() {
            var oWindow = GetRadWindow();
            oWindow.argument = null;
            oWindow.close();
            return false;
        
 
    </script>
</telerik:RadCodeBlock>

All this code is on a page that is opened through RadWindow, and the error happens before the RadAlert it is shown.
Slav
Telerik team
 answered on 11 Jul 2012
1 answer
97 views
hello,

I am using the red grid control. i am new one to use red grid to display the search result. now my requirements are columns should be dynamic (auotgenerated = true) and also apply the features like sorting,paging,and filtering. filter should be like filter template.
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx
i have google for this buy almost solutions like apply filtertemplate in aspx page.
but i want to add the filter template to the some selected columns and i have to add it from .cs page i mean using code.
if any one  know about this then plz help me
its urgent for me so guide me how to do......
Andrey
Telerik team
 answered on 11 Jul 2012
2 answers
97 views
Hi everybody,

I have a RadTabStrip and related RadPageView(in a RadMultiPage) in which I load a user control that has a RadGrid in it.

Whenever I click on sort or add new item in the grid it gets hide.

Am I missing something in the grid configuration  ? Has anyone had the same experience ?

Thank you for your consideration.
MahMah
Top achievements
Rank 1
 answered on 11 Jul 2012
0 answers
43 views
Several days ago my FireFox browser was automatically updated to 13.0.1, now when I run the demo page of RAD Grid in this address, the selection function alpha effect is no more available but a blue block.

Address of demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx


Screen snapshot:
See attached JPG.

Related property: ClientSettings.EnableDragToSelectRows

Is this a conflict between RAD ajax control and FireFox 13.x new release?
Youka
Top achievements
Rank 1
 asked on 11 Jul 2012
5 answers
464 views
Hello,

I have a RadGrid with EditFormType="WebUserControl". The UserControl has a view model (custom class) and controls on the UserControl binds to the view model. And there are radio buttons on the UserControl that causes postback.

I'm setting the UserControl's property in RadGrid's ItemCreated property.  Everything works fine until a postback is caused by the UserControl - RadGrid's ItemCreated event fires, but the DataItem property (e.Item.DataItem) of GridItemEventArgs is null after postback. So I can't set the UserControl's view model property. 

Is there a way to retain the DataItem even after a postback caused within the EditForm/UserControl?

Thanks in advance!
Makoto
Tsvetoslav
Telerik team
 answered on 11 Jul 2012
2 answers
210 views
I just upgraded to the latest release of the AJAX tools and have run into an issue with the Org Chart control, the nodes are not being displayed correctly.  Please see attached images for the issues that I am having.  Also here is the code that creates the Org Charts for the respective images.

OrgChart align issue.png Code:
private void LoadEmployees()
   {
       Directory_BO.Collections.Employees tmpEmployees = new Directory_BLL.OfficeManager().GetOfficeEmployees(OfficeToDisplay.ID);
       if (tmpEmployees.Count > 0)
       {
           tblNoEmployees.Visible = false;
       }
       else
       {
           radTabEmployees.Enabled = false;
           return;
       }
       //Set the text of the tab
       radTabEmployees.Text = "Employees (" + tmpEmployees.Count + ")";
 
       //Get the Distinct Ability Types
       var distinctDivisions = tmpEmployees.Cast<Directory_BO.Employee>().GroupBy(c => c.DivisionName).Select(grp => grp.First()).OrderBy(o => o.ContactDivision.Code);
 
       //Create the Tabs and MultiPage pageviews
       foreach (Directory_BO.Employee div in distinctDivisions)
       {
           var tmpDivEmployees = tmpEmployees.Cast<Directory_BO.Employee>().Where(c => c.ContactDivision.ID == div.ContactDivision.ID);
 
           //Add Multipage for the Division
           Telerik.Web.UI.RadPageView tmpPageView = new Telerik.Web.UI.RadPageView();
           tmpPageView.ID = "radPV" + div.ContactDivision.Code;
           radMPEmployees.PageViews.Add(tmpPageView);
 
           //Add Tab for the Divison
           Telerik.Web.UI.RadTab tmpTab = new Telerik.Web.UI.RadTab((div.ContactDivision.Code != string.Empty ? div.ContactDivision.Name : "Not Listed") + " (" + tmpDivEmployees.Count() + ")", div.ContactDivision.ID.ToString());
           tmpTab.PageViewID = tmpPageView.ID;
           radTSEmployees.Tabs.Add(tmpTab);
 
           //Create and load the RadOrgChart
           Telerik.Web.UI.RadOrgChart tmpOrgChart = new Telerik.Web.UI.RadOrgChart();
           tmpOrgChart.ID = "radOC" + div.ContactDivision.Code;
           tmpOrgChart.EnableEmbeddedBaseStylesheet = false;
           tmpOrgChart.EnableEmbeddedSkins = false;
           tmpOrgChart.Skin = "IntertekEmployee";
           tmpOrgChart.GroupColumnCount = 3;
           tmpOrgChart.DisableDefaultImage = true;
           tmpOrgChart.ItemTemplate = new EmployeeItemTemplate();
            
           //Table to hold the data for the items
           DataTable itemsTable = new DataTable();
           itemsTable.Columns.Add("NodeID");
           itemsTable.Columns.Add("FullNameLink");
           itemsTable.Columns.Add("Title");
           itemsTable.Columns.Add("FullContactInfo");
           itemsTable.Columns.Add("EmployeeID");
 
           //Add the details of the employees to the itemTable
           foreach (Directory_BO.Employee tmpC in tmpDivEmployees)
               itemsTable.Rows.Add(new string[] { "1", tmpC.FullNameLink, tmpC.Title, tmpC.FullContactInfo, tmpC.ID.ToString() });
 
           //Bind the Employee List OrgChart
           tmpOrgChart.DataSource = itemsTable;
           tmpOrgChart.DataBind();
 
           //Add a top border
           Literal tmpLiteral = new Literal();
           tmpLiteral.Text = "<div style='border-top:solid 1px #AAAAAA;'></div>";
 
           //Add the RadOrgChart to the Mulitpage
           radMPEmployees.FindControl(tmpPageView.ID).Controls.Add(tmpLiteral);
           radMPEmployees.FindControl(tmpPageView.ID).Controls.Add(tmpOrgChart);
       }
   }


OrgChart align issue2.png Code: 
private void LoadOrgChart()
    {
        Directory_BLL.EmployeeManager ContactMgr = new Directory_BLL.EmployeeManager();
 
        //Table to define the nodes
        DataTable nodeTable = new DataTable();
        nodeTable.Columns.Add("ID");
        nodeTable.Columns.Add("ManagerID");
 
        //Table to hold the data for the items
        DataTable itemsTable = new DataTable();
        itemsTable.Columns.Add("NodeID");
        itemsTable.Columns.Add("ID");
        itemsTable.Columns.Add("FullName");
        itemsTable.Columns.Add("Title");
        itemsTable.Columns.Add("CityProvince");
        itemsTable.Columns.Add("ImageURL");
 
        //Get Contacts Manager
        var tmpCM = ContactMgr.GetEmployeeByID(ContactToDisplay.ManagerID);
 
        if (tmpCM.ID != 1)
        {
            //Get Contacts Managers employees
            var tmpCME = ContactMgr.GetEmployeesByManagerID(tmpCM.ID);
 
            //Get Contacts Employees
            var tmpCE = ContactMgr.GetEmployeesByManagerID(ContactToDisplay.ID);
 
            //Add the nodes to the nodesTable
            nodeTable.Rows.Add(new string[] { "1", null });
            nodeTable.Rows.Add(new string[] { "2", "1" });
 
            //Add the details of the employees to the itemTable
            itemsTable.Rows.Add(new string[] { "1", tmpCM.ID.ToString(), "<b>" + tmpCM.OrgChartFullNameLink + "</b>", tmpCM.Title, tmpCM.City + ", " + tmpCM.Province, "EmployeePhoto.ashx?img=thumb&id=" + tmpCM.ID });
            foreach (Directory_BO.Employee tmpC in tmpCME)
            {
                itemsTable.Rows.Add(new string[] { "2", tmpC.ID.ToString(), "<b>" + tmpC.OrgChartFullNameLink + "</b>", tmpC.Title, tmpC.City + ", " + tmpC.Province, "EmployeePhoto.ashx?img=thumb&id=" + tmpC.ID });
            }
            if (tmpCE.Count > 0)
            {
                nodeTable.Rows.Add(new string[] { "3", "2" });
                foreach (Directory_BO.Employee tmpC in tmpCE)
                {
                    itemsTable.Rows.Add(new string[] { "3", tmpC.ID.ToString(), "<b>" + tmpC.OrgChartFullNameLink + "</b>", tmpC.Title, tmpC.City + ", " + tmpC.Province, "EmployeePhoto.ashx?img=thumb&id=" + tmpC.ID });
                }
            }
 
            //Setup the relationships within the OrgChart
            radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "ID";
            radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "ManagerID";
            radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataSource = nodeTable;
 
            radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "NodeID";
            radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ID";
            radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataImageUrlField = "ImageURL";
            radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataSource = itemsTable;
             
            //Bind the OrgChart
            radOrgChart.DataBind();
        }
        else
        {
            radTabOrgChart.Enabled = false;
        }
    }
OrgChart align issue2.png Markup:
<telerik:RadPageView ID="radPVOrgChart" runat="server">
           <telerik:RadOrgChart ID="radOrgChart" runat="server" GroupColumnCount="4" DisableDefaultImage="false"
               ClientIDMode="Static" Skin="Sitefinity" OnGroupItemDataBound="radOrgChart_GroupItemDataBound">
               <RenderedFields>
                   <ItemFields>
                       <telerik:OrgChartRenderedField DataField="FullName" />
                       <telerik:OrgChartRenderedField DataField="Title" />
                       <telerik:OrgChartRenderedField DataField="CityProvince" />
                   </ItemFields>
               </RenderedFields>
           </telerik:RadOrgChart>
       </telerik:RadPageView>
 
 

Peter Filipov
Telerik team
 answered on 11 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?