Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
323 views

 

Hi,

I am new to telerik control. I am upgrading gridview to radgrid.

 I am getting error (see image 1.JPG) when i am using radgrid in asp:updatepanel control. am getting this error foreveryaction(like sorting, filtering, editing, row selecting, scrolling). Can anyone help me how to sove this.

I have a linkbutton column in radgrid. when i click the button i am getting error( see image 2.JPG). How to do it in radgrid. I just want to pull sId, orderId, and taskstatus when i clicked on a linkbutton. when i am trying to do this i am getting that error. Please help to solve this.

here is my code

<asp:UpdatePanel  ID="rg200UpdatePanel"  runat="server">
                        <ContentTemplate>
                            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                            </telerik:RadScriptManager>
                            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                                <ClientEvents OnRequestStart="onRequestStart" />
                                <AjaxSettings>
                                    <telerik:AjaxSetting AjaxControlID="rg200">
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="rg200" LoadingPanelID="RadAjaxLoadingPanel1" />
                                            <telerik:AjaxUpdatedControl ControlID="RadMenu1" />
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                    <telerik:AjaxSetting AjaxControlID="RadMenu1">
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="rg200" LoadingPanelID="RadAjaxLoadingPanel1" />
                                            <telerik:AjaxUpdatedControl ControlID="RadMenu1" />
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                </AjaxSettings>
                            </telerik:RadAjaxManager>
                            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
                            </telerik:RadAjaxLoadingPanel>
                            <input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
                            <telerik:RadGrid ID="rg200" runat="server" AutoGenerateColumns="False" PageSize="30"
                                Height="550px" Width="100%" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True"
                                EnableHeaderContextMenu="True" GridLines="None" EnableHeaderContextFilterMenu="True"
                                AllowMultiRowEdit="true" AllowFilteringByColumn="True" OnPreRender="rg200_PreRender"
                                OnItemCreated="rg200_ItemCreated" EnableViewState="true" OnUpdateCommand="rg200_UpdateCommand"
                                AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                                OnPageIndexChanged="rg200_PageIndexChanged" OnItemCommand="rg216_ItemCommand">
                                <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                                    HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" />
                                <ExportSettings IgnorePaging="true" ExportOnlyData="true">
                                    <Pdf AllowModify="false" AllowPrinting="true" PageBottomMargin="" PageFooterMargin=""
                                        PageHeaderMargin="" PageHeight="11in" PageLeftMargin="" PageRightMargin="" PageTopMargin=""
                                        PageWidth="14in" />
                                </ExportSettings>
                                <MasterTableView GridLines="None" DataKeyNames="orderId" CommandItemDisplay="Top"
                                    EditMode="EditForms">
                                    <CommandItemTemplate>
                                        <div style="padding: 5px 5px;">
                                            <table>
                                                <tr class="customFont">
                                                    <td align="left">
                                                        <b>Bulk Actions</b>    
                                                    </td>
                                                    <td align="left">
                                                        <asp:LinkButton ID="btnEditSelected" runat="server" OnClick="btnEditSelected_click"
                                                            Visible='<%# rg200.EditIndexes.Count == 0 %>'>Edit Selected</asp:LinkButton>
                                                              
                                                    </td>
                                                    <td align="left">
                                                        <asp:LinkButton ID="btnUpdateEdited" runat="server" OnClick="btnUpdateEdited_click"
                                                            Visible='<%# rg200.EditIndexes.Count > 0 %>'>Update Editing</asp:LinkButton>
                                                              
                                                    </td>
                                                    <td align="left">
                                                        <asp:LinkButton ID="btnCancel" runat="server" OnClick="btnCancel_click" Visible='<%# rg200.EditIndexes.Count > 0 || rg200.MasterTableView.IsItemInserted %>'>Cancel Editing</asp:LinkButton>
                                                              
                                                    </td>
                                                    <td align="right">
                                                        <img style="border: 0px; vertical-align: middle;" alt="" src="Images/AddRecord.gif" />
                                                    </td>
                                                    <td align="left">
                                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !rg200.MasterTableView.IsItemInserted %>'>Add New Record</asp:LinkButton>
                                                              
                                                    </td>
                                                    <td align="right">
                                                        <img style="border: 0px; vertical-align: middle;" alt="" src="Images/Delete.gif" />
                                                    </td>
                                                    <td align="left">
                                                        <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected Records?')"
                                                            runat="server" CommandName="DeleteSelected">Delete Selected</asp:LinkButton>
                                                              
                                                    </td>
                                                    <td align="right">
                                                        <img style="border: 0px; vertical-align: middle;" alt="" src="Images/Refresh.gif" />
                                                    </td>
                                                    <td align="left">
                                                        <asp:LinkButton ID="LinkButton4" runat="server" CommandName="Rebind">Refresh</asp:LinkButton>
                                                                                   
                                                    </td>
                                                    <td align="left">
                                                        <asp:ImageButton ID="ExportToWordButton" runat="server" ImageUrl="~/images/ExportToWord.gif"
                                                            ToolTip="Export to Word" OnClick="ExportWord_Click" />
                                                             
                                                        <asp:ImageButton ID="ExportToExcelButton" runat="server" ImageUrl="~/images/ExportToExcel.gif"
                                                            ToolTip="Export to Excel" OnClick="ExportExcel_Click" />
                                                              
                                                        <asp:ImageButton ID="ExportToPdfButton" runat="server" ImageUrl="~/images/ExportToPdf.gif"
                                                            ToolTip="Export to Pdf" OnClick="ExportPdf_Click" />
                                                              
                                                        <asp:ImageButton ID="ExportToCsvButton" runat="server" ImageUrl="~/images/ExportToCsv.gif"
                                                            ToolTip="Export to Csv" OnClick="ExportCsv_Click" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </CommandItemTemplate>
                                    <Columns>
                                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="3%"
                                            ItemStyle-Width="3%">
                                            <HeaderStyle Width="3%"></HeaderStyle>
                                            <ItemStyle Width="3%"></ItemStyle>
                                        </telerik:GridClientSelectColumn>
                                        <telerik:GridBoundColumn UniqueName="sId" HeaderText="sId" DataField="sId" ReadOnly="true"
                                            Visible="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="orderId" HeaderText="orderId" Visible="false"
                                            ReadOnly="true" DataField="orderId">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Customer Name" HeaderText="Customer Name" DataField="Customer Name"
                                            ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Market Name" HeaderText="Market Name" DataField="Market Name"
                                            ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="LOB" HeaderText="LOB" DataField="LOB" ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Headend Name" HeaderText="Headend Name" DataField="Headend Name"
                                            ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Project Name" HeaderText="Project Name" DataField="Project Name"
                                            ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn UniqueName="Site Name" HeaderText="Site Name" DataField="SiteName"
                                            ReadOnly="true">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lnkSiteName" runat="server" Text='<%# Eval( "Site Name" ) %>'
                                                    ForeColor="Blue" CommandName="sitename"></asp:LinkButton>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn UniqueName="Task Status" HeaderText="Task Status" DataField="Task Status"
                                            ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Clarify Account Nbr" HeaderText="Clarify Account Nbr"
                                            DataField="Clarify Account Nbr">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Site ID" HeaderText="Site ID" DataField="Site ID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Quote ID" HeaderText="Quote ID" DataField="Quote ID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridCheckBoxColumn UniqueName="EDP Created?" HeaderText="EDP Created?" DataField="EDP Created?">
                                        </telerik:GridCheckBoxColumn>
                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" Visible="false" Display="false">
                                        </telerik:GridEditCommandColumn>
                                    </Columns>
                                    <EditFormSettings EditFormType="Template">
                                        <FormTemplate>
                                            <table id="Table1" cellspacing="1" cellpadding="1">
                                                <tr>
                                                    <td>
                                                        <telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop"
                                                            SelectedIndex="0" MultiPageID="RadMultiPage1">
                                                            <Tabs>
                                                                <telerik:RadTab Text="Task Data" PageViewID="RadPageView1">
                                                                </telerik:RadTab>
                                                                <telerik:RadTab Text="Notes" PageViewID="RadPageView2">
                                                                </telerik:RadTab>
                                                            </Tabs>
                                                        </telerik:RadTabStrip>
                                                        <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0">
                                                            <telerik:RadPageView runat="server" ID="RadPageView1">
                                                                <table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0" class="module">
                                                                    <tr>
                                                                        <td>
                                                                        </td>
                                                                        <td>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            Clarify Account Nbr:
                                                                        </td>
                                                                        <td>
                                                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval( "Clarify Account Nbr" ) %>'>
                                                                            </asp:TextBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            Site ID:
                                                                        </td>
                                                                        <td>
                                                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval( "Site ID") %>' TabIndex="1">
                                                                            </asp:TextBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            Quote ID:
                                                                        </td>
                                                                        <td>
                                                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Eval( "Quote ID") %>' TabIndex="2">
                                                                            </asp:TextBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            EDP Created?:
                                                                        </td>
                                                                        <td>
                                                                            <asp:CheckBox ID="CheckBox1" runat="server" Text='<%# Eval( "EDP Created?") %>' TabIndex="3">
                                                                            </asp:CheckBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td align="right" colspan="2">
                                                                            <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                                runat="server" CommandName='Update'></asp:Button
                                                                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                                                CommandName="Cancel"></asp:Button>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </telerik:RadPageView>
                                                            <telerik:RadPageView runat="server" ID="RadPageView2">
                                                            </telerik:RadPageView>
                                                        </telerik:RadMultiPage>
                                                    </td>
                                                </tr>
                                            </table>
                                        </FormTemplate>
                                    </EditFormSettings>
                                </MasterTableView>
                                <ClientSettings EnableRowHoverStyle="true" ReorderColumnsOnClient="false" AllowDragToGroup="false"
                                    AllowColumnsReorder="True">
                                    <Scrolling AllowScroll="true" EnableVirtualScrollPaging="false" UseStaticHeaders="true" />
                                    <Selecting AllowRowSelect="true"></Selecting>
                                    <Resizing AllowRowResize="true" AllowColumnResize="True" EnableRealTimeResize="True"
                                        ResizeGridOnColumnResize="False"></Resizing>
                                    <ClientEvents OnRowContextMenu="RowContextMenu" OnRowDblClick="RowDblClick"></ClientEvents>
                                </ClientSettings>
                                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
                            </telerik:RadGrid>
                        </ContentTemplate>
                    </asp:UpdatePanel>

 

 

.cs file

 

protected void rg216_ItemCommand(object source, GridCommandEventArgs e)
    {
        try
        {
            if (e.CommandName.ToLower() == "sitename")
            {
                GridViewRow rw = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                Label lblsId = (Label)rw.FindControl("lblsId");
                Label lblorderId = (Label)rw.FindControl("lblorderId");
                Label lblTaskStatus = (Label)rw.FindControl("lblTaskStatus");
                //Label lblsId = (Label)e.Item.FindControl("lblsId");
                //Label lblorderId = (Label)e.Item.FindControl("lblorderId");
                //Label lblTaskStatus = (Label)e.Item.FindControl("lblTaskStatus");
                Session["selorderID"] = lblorderId.Text.Trim();
                Session["selsID"] = lblsId.Text;
                Session["selTaskStatus"] = lblTaskStatus.Text;
                ScriptManager.RegisterClientScriptBlock(this.rg200UpdatePanel, this.GetType(), "strSearSiteName", "document.getElementById('ctl00_PagePlaceholder_ifrmPopups').src='OrdDet.aspx'", true);
                ScriptManager.RegisterClientScriptBlock(this.rg200UpdatePanel, this.GetType(), "open", "openpopup()", true);
                ifrmPopups.Style.Add("height", "409px");
                LinkButton lnkSiteName = (LinkButton)rw.FindControl("lnkSiteName");
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Raj
Top achievements
Rank 1
 answered on 15 Jul 2010
4 answers
233 views
Hello, I have a trouble adding items to RadComboBox in client side.
I tried to add items in two different ways:

In this way:
    FillServiceTypes: function () {
        var i = 0;
        var servTypeComboBox = $find("<%= rcbServiceTypes.ClientID%>");
        for (i = 0; i <= 5; i++) {
            var rcbItem = new Telerik.Web.UI.RadComboBoxItem();
            rcbItem.set_text("Item " + i);
            rcbItem.set_value(i);
            servTypeComboBox.trackChanges();
            servTypeComboBox.get_items().add(comboItem);
            servTypeComboBox.select();
            servTypeComboBox.commitChanges();
        }
    }

And in this other:
    FillServiceTypes: function () {
        var i = 0;
        var items = [];
        var servTypeComboBox = $find("<%= rcbServiceTypes.ClientID%>");
        for (i = 0; i <= 5; i++) {
            var rcbItem = new Telerik.Web.UI.RadComboBoxItem();
            rcbItem.set_text("Item " + i);
            rcbItem.set_value(i);
            items[items.length] = rcbItem;
        }
        servTypeComboBox.insertItems(items);
    }

In both ways i received this error:
Microsoft JScript runtime error: Object doesn't support this property or method

Can someone help me how to resolve this trouble?, please.
Thanks in advance.

Francisco.


Francisco Tirado
Top achievements
Rank 1
 answered on 15 Jul 2010
6 answers
304 views
Hi,

I have a 2-part question. I have a radgrid populated using a datatable, with columns that are autogenerated. All is well, I can view the edit form and drop down into my events.

My first question is how are autogenerated controls named? I'd like to disable the first column so a user cannot edit it as it is an identity column but I'm having trouble finding the control. I use the below when I know the string Id of the control:

string

 

xx= (userControl.FindControl("xx") as TextBox).Text;

But obviously can't use this method without knowing the string id of the autogenerated edit controls.

Second question is what is the best method to get the changed values of autogenerated controls?
I have so far:

 

 

GridEditableItem editedItem = e.Item as GridEditableItem;

 

 

 

 

 

// Get the new values

 

 

 

 

 

Hashtable newValues = new Hashtable();

 

e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

But I may have a mix of different types in the newValues hashTable and thus can't to a CopyTo strongly typed array.

Need some help please, thanks!

Brad
Top achievements
Rank 1
 answered on 15 Jul 2010
3 answers
168 views
Hello Telerik Team,

I have the following scenario:

a raddatagrid, using a radajaxmanager, created programmatically, populated in "onneeddata"

a radmenu acting as a context menu, also created programmatically, and populated with (hierarchical) menu items

client-side listener on onrowcontextmenu on the grid, which looks like this:

 function RowContextMenu(sender, eventArgs) { 
            var menu = $find("ctl00_ccp_rgid"); 
            var id = eventArgs.getDataKeyValue("ID"); 
            for (var i = 0; i < menu._children._array.length; i++) { 
                setMenuLink(menu._children._array[i],id); 
            } 
    }  
 
 
        function setMenuLink(menuitem, id) { 
            if (menuitem._linkElement != null) { 
                setID(menuitem._linkElement.href, id); 
                menuitem._linkElement.href = setID(menuitem._linkElement.href, id);        } 
            if (menuitem._children != null && menuitem._children._array != null) { 
                for (var i = 0; i < menuitem._children._array.length; i++) { 
                    setMenuLink(menuitem._children._array[i], id); 
                } 
            } 
        } 

I face two problems

1) When I first right click on a row, only the top level menu items are set with "setMenuLink", because "menuitem._children is null. When I wait for a second and right click a second time, menuitem._children has the correct entries and everything works. How can I change my approach to make this work?
2) If a ajax postback happens (by filtering, grouping, sorting, changing the page etc.) the contextmenu stops working. onrowcontextmenu is triggered, and
var menu = $find("ctl00_ccp_rgid");
even returns the correct menu object, but no menu is drawn on screen, neither is the onclientshowing event triggered. The ContextMenu is created programmatically like this (snippet from the OnInit-Method of the UserControl (a derivate from a radsplitter) hosting both the grid and the context menu):

  if (this.GridController.DataGrid is WebControl) 
            { 
                ContextMenuControlTarget target = new ContextMenuControlTarget(); 
                target.ControlID = (this.GridController.DataGrid as WebControl).ID; 
                (this.GridController.DataGrid as RadGrid).ClientSettings.ClientEvents.OnRowContextMenu = "RowContextMenu"
                RadContextMenu menu = new RadContextMenu(); 
                menu.OnClientShowing = "OnClientShowing"
                menu.ID = "rgid"
    
                ICollection<WebNavigationNode> nodes = (this.Engine as ASPNetTelerikEngine).GetNavigationNodesForRecord(this.Record); 
 
                foreach (WebNavigationNode node in nodes) 
                { 
                    this.addNavigationNode(menu, null, node); 
                } 
                menu.Targets.Add(target); 
                menu.Skin = this.Skin; 
                gridpane.Controls.Add(menu); 
            } 


Any help is greatly appreciated

best regards

Ulrik




Ulrich
Top achievements
Rank 1
 answered on 15 Jul 2010
4 answers
511 views
Hi Telerik
I want to update particular control e.g <asp:panel /> or any control but only after ajaxrequest.

Now in this situation i have asp:panel which should rendered ascx page after ajax request executed. can i know the server side code to render / Refresh particular control only, not all controls. only particular?

and i dont want to handle this inside aspx page with radajaxmanager i want to handle this through code behind after ajaxrequest only.

ajax request will validate the condition then base on condition it should render or refresh particular control only.

Kind regards:
Maria Ilieva
Telerik team
 answered on 15 Jul 2010
1 answer
80 views

Dear Team

I am Using telerik Rad grid in My Web application .I have some problem in click add new Record. Whenever I clicked add new Record link in grid it is take long Time. Why, I didn’t find .Please give a Good Solution.My Code Given Below..I am using Role Based Contion Checking in Code Behind..

  <div style="overflow: scroll; height: 245px;width:100%">

                                       <asp:UpdatePanel ID="UpdatePanel11" runat="server">

                                            <ContentTemplate>

                                                <table width="100%" style="margin-left: 10px">

                                                    <tr>

                                                        <td>

                                                            <telerik:RadGrid ID="radgridActivity" runat="server" Skin="Vista" Width="650px" Height="300px"

                                                                AutoGenerateColumns="False" Visible="true" AutoGenerateEditColumn="true"  ShowStatusBar="false" GridLines="None"  OnInsertCommand="Activity_InsertCommand" AllowPaging="True"

                                                                OnNeedDataSource="Activity_NeedDataSource" OnItemDataBound="radgridActivity_ItemDataBound"  OnItemCreated="radgridActivity_ItemCreated"

                                                                AllowSorting="True" PageSize="10" OnUpdateCommand="Activity_UpdateCommand" OnDeleteCommand="RadGridActivity_DeleteCommand" >

                                                                <MasterTableView  EditMode="PopUp" DataKeyNames="activityid" AutoGenerateColumns="false"  AllowSorting="true"  

                                                                    EditFormSettings-PopUpSettings-ScrollBars="Vertical" EditFormSettings-PopUpSettings-Height="200px">

Code Bind:

 protected void radgridActivity_ItemDataBound(object sender, GridItemEventArgs e)
        {


            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;
                GridEditManager editMan = editedItem.EditManager;
                GridTextBoxColumnEditor txtRate = (GridTextBoxColumnEditor)editedItem.EditManager.GetColumnEditor("Firstname");
                if (cmbCustomerId.Text != "Select a Client..")
                    txtRate.TextBoxControl.Text = cmbCustomerId.Text;
                TextBox CustomerName = editedItem["Firstname"].Controls[0] as TextBox;
                CustomerName.Enabled = false;
                TextBox ActStatus = editedItem["status"].Controls[0] as TextBox;
                ActStatus.Enabled = false;
                if (e.Item.DataSetIndex != -1)
                {
                    ((RadComboBox)e.Item.FindControl("RadComboBox1")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["actiontype"].ToString();
                    ((RadComboBox)e.Item.FindControl("RadComboBox2")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["nextactiontype"].ToString();

                    ((RadComboBox)e.Item.FindControl("cmbPriority")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["Priority"].ToString();
                    ((RadComboBox)e.Item.FindControl("cmbActivityFor")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["ActivityFor"].ToString();
                    ((RadComboBox)e.Item.FindControl("cmbScheduledFor")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["ScheduledFor"].ToString();
                    ((RadComboBox)e.Item.FindControl("cmbScheduleBy")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["ScheduleBy"].ToString();
                    ((RadComboBox)e.Item.FindControl("cmbRecurringFreq")).SelectedValue = (e.Item.DataItem as System.Data.DataRowView)["RecurringFreq"].ToString();
                }

            }


            if (e.Item is GridDataItem)
            {

                GridDataItem gridDataItem = (GridDataItem)e.Item;
                Hashtable values = new Hashtable();
                gridDataItem.ExtractValues(values);
                string status = values["status"].ToString();
                ImageButton btnDelete = gridDataItem["Delete"].Controls[0] as ImageButton;
                ImageButton btnEdit = gridDataItem["Edit"].Controls[0] as ImageButton;
                if (Session["sesUserType"].ToString() == "Sales Rep")
                {
                    if (status.Equals("Submitted"))
                    {
                        btnDelete.ImageUrl = "Styles/Images/DeleteBin1.gif";
                        btnDelete.Enabled = false;
                    }
                    else
                    {
                        btnDelete.ImageUrl = "Styles/Images/DeleteBin.gif";
                        btnDelete.Enabled = true;
                    }
                }
                else
                {
                    btnEdit.ImageUrl = "Styles/Images/EditWDT1.gif";
                    btnDelete.ImageUrl = "Styles/Images/DeleteBin1.gif";
                    btnDelete.Enabled = false;
                    btnEdit.Enabled = false;
                }


            }
        }

Tsvetoslav
Telerik team
 answered on 15 Jul 2010
1 answer
162 views
Hello i am currently using following:

DotNetNuke 5.4.4 with Turkish Language pack installed.
Server environment have Windows Server 2003 and SQL Server Express 2008 with SQL_Latin1_General_CP1_CI_AS as server and database collation.

Most of tables store Turkish characters without converting them to Friendly or numeric code (and those are usually text box fields)
(you can check following link to understand me better)
http://webdesign.about.com/od/localization/l/blhtmlcodes-tr.htm

However, there is one thing drives me crazy. That is HTML editor. Looks like after clicking update dbo.HTMLText table stores Turkish characters with Friendly codes.

For example on my portal i can see Türkçe as Türkçe when browsing. However when viewing page source or database table called htmlText i see that all Turkish chars displayed as friendly codes. [t&uuml;rk&ccedil;e]

I pretty suspect that this is why my search does not list all results with html content.
Also when i try to submit a page of mine to Digg, or similar social platform they simply don't recognize the text and fills some of content with question marks.

Any suggestions?
Rumen
Telerik team
 answered on 15 Jul 2010
6 answers
718 views
Hi,

I would like to develop the ability to conditional format a radgrid based upon a value within a field.

My radgrid data is built on the NeedDataSource and is pretty simple. I have done a quick sweep of google for conditional formatting, but i cant seem to find a simplistic answer on how to achieve it.

This is my senario.

I have a column in the grid called "Status" i want to format the background of rows with a status of "R"  to a shade of red.

All other status' need not deviate from the standard formatting.

Can some offer a bit of code or advice on how to achive this?

Many Thanks


Iain
Top achievements
Rank 1
 answered on 15 Jul 2010
3 answers
121 views
Hi,

In my current project I have a RadGrid with the following columns:
- Name of type GridBoundColumn
- Email of type GridBoundColumn
- TestEmail of type GridButtonColumn
- Mobile of type GridBoundColumn
- TestSMS of type GridButtonColumn

The web page is available on http://www.gouw.ws/RadGridWithButtons.aspx

Can you please tell me:
1. On each row,
    - how to disable the TestEmail button if the Email column is empty, and
    - how to disable the TestSMS button if the Mobile column is empty
2. How to process on the code behind when the TestEmail button or TestSMS button is clicked?

The ASPX is given as follows:
<telerik:RadGrid ID="radGrid" AutoGenerateColumns="false" AllowSorting="true" OnNeedDataSource="radGrid_NeedDataSource" runat="server">
    <ClientSettings>
        <Scrolling UseStaticHeaders="true" />
    </ClientSettings>
    <MasterTableView TableLayout="Fixed">
        <Columns>
            <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderStyle-Width="20%" HeaderText="Name" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" AllowSorting="true" UniqueName="Name" />
            <telerik:GridBoundColumn DataField="Email" DataType="System.String" HeaderStyle-Width="20%" HeaderText="Email" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" AllowSorting="true" UniqueName="Email" />
            <telerik:GridButtonColumn ButtonType="PushButton" Text="Test Email" HeaderStyle-Width="5%" HeaderText="Test" HeaderStyle-HorizontalAlign="Center" CommandName="TestEmail" UniqueName="TestEmail" />
            <telerik:GridBoundColumn DataField="Mobile" DataType="System.String" HeaderStyle-Width="20%" HeaderText="Mobile (SMS)" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" AllowSorting="true" UniqueName="Mobile" />
            <telerik:GridButtonColumn ButtonType="PushButton" Text="Test SMS" HeaderStyle-Width="5%" HeaderText="Test" HeaderStyle-HorizontalAlign="Center" CommandName="TestSMS" UniqueName="TestSMS" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Regards,
Herman
rock
Top achievements
Rank 1
 answered on 15 Jul 2010
9 answers
437 views
I finally got Q3 upgrade installed and I am now trying to use the
<CommandItemSettings
                    ShowExportToWordButton="true"
                    ShowExportToExcelButton="true"
                    ShowExportToCsvButton="true"
                    ShowExportToPdfButton="true"
                    />

in my current application.  Intellisense says that these are not valid attributes of the CommandItemSettings element.  I have looked at your example code in your demo site and they work there just fine.  I copied your code into my grid definition and it does not work. What am I doing wrong?  How do I get the Command item buttons to appear in my RadGrids CommandItemDisplay area?
Andrew
Top achievements
Rank 1
Veteran
Iron
 answered on 15 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?