Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
182 views
Hi,

I have a Rad grid and Client side, I am trying to retrieve the value of a cell in Javascript.

I followed the following example, to try and get it to work.
http://www.telerik.com/help/aspnet-ajax/grdgettingcellvaluesforselectedrowsclientside.html

However, I get the following javascript error when selecting the grid row and trying to get the innerHTML value.
"Microsoft JScript runtime error: 'getCellByColumnUniqueName(...).innerHTML' is null or not an object"

Following is the markup for the Grid:

 

 

 
  <telerik:RadGrid ID="RadGridMapFilter"  runat="server" AllowPaging="True" AllowMultiRowSelection="True"  ClientSettings-EnablePostBackOnRowClick="false" ShowHeader="true" 
                            PagerStyle-Mode="Slider" GridLines="Horizontal"   
                            Width="377px" AutoGenerateColumns="False" Height="320px" ClientSettings-ClientEvents-OnRowSelected="RowSelected" ClientSettings-ClientEvents-OnRowClick="RowClickPeerGrid" > 
                          
                        <MasterTableView> 
                        <columns>                                                                 
                        <telerik:GridBoundColumn DataField="FilterAbb" HeaderText="Filters"   
                            SortExpression="Filters" Visible="false" /> 
                        <telerik:GridBoundColumn DataField="FilterName" HeaderText="Filters"   
                            SortExpression="Filters" Visible="true" /> 
 
                        </columns> 
                          
                            <RowIndicatorColumn Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Resizable="False" Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                            <EditFormSettings> 
                                <PopUpSettings ScrollBars="None" /> 
                            </EditFormSettings> 
                        </MasterTableView> 
                        <ClientSettings> 
                            <Selecting AllowRowSelect="True" /> 
                        </ClientSettings> 
                    </telerik:RadGrid> 
 


and following are the two javascript functions:

 

function RowSelected(sender, eventArgs)  
 {  
   var dataItem = $get(eventArgs.get_id());  
   var grid = sender;  
   var MasterTable = grid.get_masterTableView();  
   var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];  
   var cell = MasterTable.getCellByColumnUniqueName(row, "FilterAbb").innerHTML;;    
   //var strRowValue = cellinnerHTML;  
  //here cell.innerHTML holds the value of the cell    
   alert(cell);    
 }  
 
function GetSelectedNames()  
 {  
   var grid = $find("<%=RadGridMapFilter.ClientID %>");  
   var MasterTable = grid.get_masterTableView();  
 
   var selectedRows = MasterTable.get_selectedItems();  
   for (var i = 0; i < selectedRows.length; i++)  
   {  
     var row = selectedRows[i];  
     var cell = MasterTable.getCellByColumnUniqueName(row, "FilterAbb")  
       
     alert(cell.innerHTML);  
       
    //here cell.innerHTML holds the value of the cell  
   }  
 }  
 

Any help would be appreciated.

 


Thank you,
Anshul.

 

Anshul
Top achievements
Rank 1
 answered on 04 Jun 2009
2 answers
210 views
I recently upgraded from telerik 2008 to 2009 version.  Since that, (I am not sure if this is THE cause), I have trouble with a treeview in my application, when it is ajax updated.  This trouble only occurs in Chrome and Safari.

My treeview is in a usercontrol on a radpageview, inside a radmultipaged, controlled by a radtabstrip.

I enabled the RenderSelectedPageOnly=True property because my tabs may contain a lot of html and I don't want to send everything to the browser.  

With that property set to true, my treeview is only displaying correctly on the first display.  If I do any ajax action on my page that affects the treeview (treeview click or tab change), I lose my correct display of the treeview, I only see the "ul/li" visual, I lose every checkbox images.  I only see a bullet list.  

I have ajax settings activated with radajaxmanagerproxy (no ajaxpanel) for the tabstrip and the treeview, with autopostback on the tabstrip to load the selected radpageview on click.

That was not a trouble with the 2008 Q4 version of radcontrols, and it is not a trouble with Firefox3 and IE8.  This only occurs in Chrome(1/2/3) and Safari (4, certainly 3 also), and with the 2009 Q1 version of radcontrols.
Bridge24
Top achievements
Rank 1
Iron
Iron
 answered on 04 Jun 2009
2 answers
129 views
Hi there, I have a RadGrid (Q1 2009 release) and I want to group by the LanguageID that I am pulling from my LinqDataSource while displaying the accompanying Language instead of the ID.  I am attempting to use the FieldAlias for the Language, but this is not working.  Here is my code.  My LinqDataSource is pulling: SurveyID, SurveyGroupID, SurveyGroupName, LanguageID, Language from the database directly.  I can group by anything, but no matter what I group by, the FieldAlias does not do anything.


<telerik:RadGrid ID="rdgSurveys" runat="server" DataSourceID="ldsSurveys" GridLines="None" Skin="Office2007" AutoGenerateColumns="False"
        <MasterTableView DataKeyNames="SurveyID" DataSourceID="ldsSurveys" GroupLoadMode="Client"
          <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
          </RowIndicatorColumn> 
          <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
          </ExpandCollapseColumn> 
          <Columns> 
            <telerik:GridButtonColumn Text="Select" CommandName="Select"
            </telerik:GridButtonColumn> 
            <telerik:GridEditCommandColumn> 
            </telerik:GridEditCommandColumn> 
            <telerik:GridBoundColumn DataField="SurveyID" DataType="System.Int32" HeaderText="SurveyID" ReadOnly="True" SortExpression="SurveyID" UniqueName="SurveyID"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="SurveyGroupID" DataType="System.Int32" HeaderText="SurveyGroupID" SortExpression="SurveyGroupID" UniqueName="SurveyGroupID" Visible="False" ReadOnly="true"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="SurveyGroupName" DataType="System.String" HeaderText="SurveyGroupName" SortExpression="SurveyGroupName" UniqueName="SurveyGroupName" Visible="False" ReadOnly="true"
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn DataField="LanguageID" DataType="System.Int32" HeaderText="Language" SortExpression="LanguageID" UniqueName="LanguageID"
              <EditItemTemplate> 
                <asp:DropDownList ID="ddlLanguages" runat="server" DataSourceID="ldsLanguages" DataTextField="Language" DataValueField="LanguageID" SelectedValue='<%# Bind("LanguageID") %>' Width="200px"
                </asp:DropDownList> 
              </EditItemTemplate> 
              <ItemTemplate> 
                <asp:Label runat="server" ID="lblLanguage" Text='<%# Eval("Language") %>'></asp:Label> 
              </ItemTemplate> 
            </telerik:GridTemplateColumn> 
          </Columns> 
          <GroupByExpressions> 
            <telerik:GridGroupByExpression> 
              <SelectFields> 
                <telerik:GridGroupByField FieldName="LanguageID" FieldAlias="Language" HeaderText="Survey Group" /> 
              </SelectFields> 
              <GroupByFields> 
                <telerik:GridGroupByField FieldName="LanguageID" FieldAlias="Language" /> 
              </GroupByFields> 
            </telerik:GridGroupByExpression> 
          </GroupByExpressions> 
          <EditFormSettings> 
            <EditColumn UniqueName="EditCommandColumn1"
            </EditColumn> 
          </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings Selecting-AllowRowSelect="True" EnablePostBackOnRowClick="True"
          <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
        <FilterMenu EnableTheming="True"
          <CollapseAnimation Type="OutQuint" Duration="200"
          </CollapseAnimation> 
        </FilterMenu> 
      </telerik:RadGrid> 

Redmond Rinehart
Top achievements
Rank 1
 answered on 04 Jun 2009
2 answers
150 views
Hi ,
I have an AppointmentTemplate referenced in HTML with 2 labels.
How do i edit the properties of these labels within code ?

<AppointmentTemplate>

<asp:Label ID="lblAppointmentHeader2" runat="server" CssClass="appt" Text='<%# Bind("Subject") %>'></asp:Label>

</AppointmentTemplate>


Many Thanks
Mark

Mark
Top achievements
Rank 2
 answered on 04 Jun 2009
0 answers
245 views
I have two sites on the same server is a public and another private, I've created a virtual directory to put all documents and images to upload from the private site and that people who consult the site the public can see. The problem is that when you send me the address error, I put that path when uploading files from radupload.

Option 1:   
f.SaveAs(Server.MapPath("../Documentos/PDF/RRHH/") & f.GetName)  
 
Option 2:   
f.SaveAs(Server.MapPath("~/Documentos/PDF/RRHH/") & f.GetName)   
 
Option 3:   
f.SaveAs(Server.MapPath("/Documentos/PDF/RRHH/") & f.GetName)   
 

 

 

Another Option:
?

Roderick
Top achievements
Rank 1
 asked on 04 Jun 2009
1 answer
40 views
Hi,

I've got 8 RadEditor's on one page, with 7 of them all pointing at the first one's ID to use it's toolbar. The toolbar itself loads fine, and works as expected. The issue is with the 'Spelling' toolbar button, which when clicked on the first editor displays a list of languages, "English (GB)", as that's all I'm listing under SpellCheckerLanguage. Clicking this then loads the spell checker and it works fine. However, clicking the spelling icon on any of the other 7 editors just displays an empty list of languages, and due to this I can't actually initiate a spell check on them.

If this is a known issue please point me in the right direction, as I've searched the forums to no avail.

Many thanks,
Wayne
Wayne
Top achievements
Rank 1
 answered on 04 Jun 2009
3 answers
363 views
Hello
Is it possible to change de scrollbar color?
I'm using the skin Office2007
Thank you

Myriam
Myriam
Top achievements
Rank 1
 answered on 04 Jun 2009
6 answers
160 views
I have an issue that I just cant seem to get correct, and I really do not understand why.

I have a page that loads some HTML from a SQL database and I want it displayed in the RadEditor control.  The idea is to load the record they have marked as default on the page load, and then have a ComboBox so they can switch from record to record.  The html that comes from the database doesn't have any header tags like "<html>" or "<header>", but it is well formed html with style and formatting tags like tables, paragraphs, etc...

 
<tr> 
                        <td align="right"
                            Message Template:</td> 
                        <td width="25" align="left"
                            &nbsp;</td> 
                        <td align="left"
                            <telerik:RadComboBox ID="list_templates" Runat="server" Skin="Sunset"  
                                AppendDataBoundItems="True" AutoPostBack="True" DataTextField="msg_title"  
                                DataValueField="id"  
                                OnSelectedIndexChanged="list_templates_SelectedIndexChanged"  
                                DataSourceID="sqlds_MsgTemplates"
                                <CollapseAnimation Duration="200" Type="OutQuint" /> 
                            </telerik:RadComboBox> 
                        </td> 
                    </tr> 
 <tr> 
                        <td align="right"
                            Message Subject:</td> 
                        <td> 
                            &nbsp;</td>
                        <td align="left"
                            <telerik:RadTextBox ID="txt_Sub" Runat="server" Skin="Sunset" Width="400px" Text=""
                            </telerik:RadTextBox> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td colspan="3"><center> 
                            <telerik:RadEditor ID="editor_SEND" runat="server" BorderStyle="None"  
                                EditModes="Preview" Height="400px" Skin="Sunset"  
                                ToolsFile="UserControls/EditorToolbar.xml" Width="700px"
                                <Content> 
</Content> 
                            </telerik:RadEditor></center
                            <br /> 
                            <br /> 
                            <asp:Button ID="btn_SendMsg" runat="server" CssClass="RadDefaultButton"  
                                Text="Send Message" /> 
                        </td> 
                    </tr> 

On Page Load I want to get the record (which loads successfully) and display it in the control. However on page load when I do the following, the editor is empty and it is not in preview mode - the toolbar buttons are still luminated.
If Not IsPostBack Then 
 
Try 
 
                    Using reader As SqlDataReader = Msg_Info.GetDealerTemplateByID(CInt(Request.QueryString("Record"))) 
 
                        If reader.HasRows Then 
 
                            reader.Read() 
 
                            txt_Sub.Text = reader.GetSqlString(0).ToString() 
                            editor_SEND.Content = reader.GetSqlString(1).ToString() 
 
                        End If 
 
                        reader.Close() 
 
                    End Using 
 
                Catch ex As Exception 
                    'error 
                End Try 
 
End If 



But then when I do this - it works fine:
Protected Sub list_templates_SelectedIndexChanged(ByVal o As ObjectByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) 
 
Dim msgID As Integer = list_templates.SelectedValue 
 
Try 
 
                    Using reader As SqlDataReader = Msg_Info.GetDealerTemplateByID(msgID) 
 
                        If reader.HasRows Then 
 
                            reader.Read() 
 
                            txt_Sub.Text = reader.GetSqlString(0).ToString() 
                            editor_SEND.Content = reader.GetSqlString(1).ToString() 
 
                        End If 
 
                        reader.Close() 
 
                    End Using
 
                Catch ex As Exception 
 
                End Try 
 
    End Sub 

They are identical but why doesn't the page load display it properly?



Rumen
Telerik team
 answered on 04 Jun 2009
9 answers
175 views
Hi

I have RadWindow that opens up a popup modal dialog from a button and a button in a Radgrid on a given page. It behaves so incosistent.Sometimes one of those buttons bring up the modal. When i hit other button that brings up the same modal ,it does not show up. Then the modal popup stops functioning from any button click. I use Rad ASP Net Ajax Q2 2008. I am brand new to this. I am really bugged by this behaviour.

The code snippet on my page is

<!--Telerik Control for CreateNew.. Telerik Modal window -->

 

<telerik:radwindow ID="ModalPopup" runat="server" Behavior="None"

 

 

ClientCallBackFunction="RefreshList()" Height="600px" Modal="True"

 

 

Width="800px"

 

 

NavigateUrl="~/shared/PopupDialog.aspx?uc=~/Usercontrols/ProgramTypeMaint.ascx"

 

 

OpenerElementID="<%# btnAdd.ClientID %>" VisibleStatusbar="False"

 

 

VisibleTitlebar="False" KeepInScreenBounds="True" Overlay="True"

 

 

Skin="Vista"></telerik:radwindow>

 

This works sometimes and does not popup modal sometimes.

The grid is

 

 

<!-- List Display --->

 

 

 

 

 

 

<asp:Panel runat="server" ID="ResultPnl">

 

 

 

 

 

 

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

 

 

 

 

 

 

<ContentTemplate>

 

 

 

 

 

 

<telerik:RadGrid ID="grdProgramTypes" runat="server" AllowPaging="true"

 

 

AutoGenerateColumns="false" EnableEmbeddedSkins="false" GridLines="None"

 

 

 

 

 

 

Skin="Trizetto" ImagesPath="~/images/RadControls/Grid" Height="100%"

 

 

Width="100%" AllowSorting="true" Visible="false"

 

 

OnItemDataBound="grdProgramTypes_ItemDataBound" PageSize="10"

 

 

 

 

 

 

onneeddatasource="grdProgramTypes_NeedDataSource" >

 

 

 

 

 

 

<ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">

 

 

 

 

 

 

<Selecting AllowRowSelect="false" />

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

 

<MasterTableView>

 

 

 

 

 

 

<RowIndicatorColumn>

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

 

<ExpandCollapseColumn>

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

<tzg:LocalizableGridBoundColumn ID="Name" HeaderText="Desc" HeaderButtonType="TextButton" DataField="Description"> </tzg:LocalizableGridBoundColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Actions" HeaderButtonType="TextButton" UniqueName="Action">

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<asp:ImageButton ID="btnModify" ImageUrl="~/images/editdoc16.gif" runat="server" ToolTip="Click here to edit this record" />

 

 

 

 

 

 

<asp:ImageButton ID="btnDelete" ImageUrl="~/images/delete.gif" runat="server" ToolTip="Click here to delete this record" />

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

<ItemStyle Width="40px" />

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

</telerik:RadGrid>

 

 

 

 

 

 

</ContentTemplate>

 

 

</asp:UpdatePanel>

 

 

 

 

 

 

</asp:Panel>

The btn modify also opens up the modal. It is also inconsistent in its behaviour. Looking for some insights asap

Thanks
Geetha

 

Geetha
Top achievements
Rank 1
 answered on 04 Jun 2009
8 answers
465 views
Hey Everyone,

I'm having trouble making the Edit Image button on each record invisible.  I want to be able to Add and Delete Records, but not be able to Edit them.  However, if I do not generate/create an Edit button, the Insert/Cancel image buttons do not appear when I add a new record.  Can someone please tell me the correct settings I need?  Thanks.
Peter Obiefuna
Top achievements
Rank 1
 answered on 04 Jun 2009
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?