Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
93 views
Hi,

I have the following radgrid integrated to my application.

<telerik:RadGrid ID="grdCompanyList"
                runat="server" GridLines="None"
                AutoGenerateColumns="False"
                AllowSorting="True"
                AllowFilteringByColumn = "True"
                AllowPaging="True"
                EnableLinqExpressions="False"
                PageSize="10"
                OnNeedDataSource="grdCompanyList_NeedDataSource"
                OnItemCreated="grdCompanyList_ItemCreated">
                 
                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>                               
                <MasterTableView DataKeyNames="watchlist_id" CommandItemDisplay="Top" EditMode="PopUp">
                <CommandItemSettings ShowAddNewRecordButton="false"/>
                <Columns>
 
                    <telerik:GridBoundColumn DataField="watchlist_id" DataType="System.Int32"
                        HeaderText="watchlist_id" ReadOnly="True" SortExpression="watchlist_id"
                        UniqueName="watchlist_id" Visible="false" >
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn DataField="company_id" DataType="System.Int32"
                        HeaderText="company_id" ReadOnly="True" SortExpression="company_id"
                        UniqueName="company_id" Visible="false" >
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="180px">
                    <ItemTemplate>
                        <asp:Image width="142" height="58" ID="CompLogos" ImageUrl="<%# showCompLogo(Container.DataItem) %>"
                         runat="server" AlternateText="Logo" />
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>
                     
                    <telerik:GridBoundColumn DataField="company_name"
                        HeaderText="Company name" SortExpression="company_name" ItemStyle-Width="450"
                        UniqueName="company_name" ReadOnly="true">
                        <ItemStyle Width="450px" />
                    </telerik:GridBoundColumn>                  
                   
                    <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="50px">
                    <ItemTemplate>
                        <asp:HyperLink ID="CoLink"  runat="server" Text="Edit" ImageUrl="~/images/viewicon_big.png" ToolTip="View Details"></asp:HyperLink>
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>                  
 
                </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true"></ClientSettings>
                </telerik:RadGrid>
 
I need to extract the company ids which is in the second column in the grid and use that to redirect to a different page.
I have used the following code:

protected void grdCompanyList_ItemCreated(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridDataItem)
       {
           HyperLink CoLink = (HyperLink)e.Item.FindControl("CoLink");
           GridDataItem item = (GridDataItem)e.Item;
           string Cid = item["company_id"].Text;
           CoLink.Attributes["href"] = "CompanyDetails.aspx?Id=" + Cid;
       }
   }

However the above doesn't work.

Please suggest I can i extract the data from the seconds column.

Thanks,

Debashis

Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
2 answers
523 views
I have a grid which I'm populating via pivot table in the code behind...therefore the columns are set to auto-generate.

I'd like to modify the header template so that the values are displayed as hyperlinks...I'll need to be able to programmatically create the hyperlink for each column using the header template text as a value.

Can you show me how to do this? I've gotten access to the header columns using the following Grid_PreRender event

protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    RadGrid grid = ((RadGrid)sender);
 
    foreach (GridItem header in grid.MasterTableView.GetItems(GridItemType.Header))
    {
 
    }
}

I just don't know what I need to do in the foreach loop to change the header text to make it a hyperlink of the value.

Thanks for the help =)
Philip Senechal
Top achievements
Rank 1
 answered on 03 Feb 2011
1 answer
207 views

If user changes the name in the textbox user is shown with confirm box  ok , cancel
if user clicks on ok edited name need to be changed
if user clicks on cancel old name need to be repopulated 
Here i am facing problem in
1. repopulating the textbox with oldvalue
2.these textbox is placed in textbox when ever page is getting loaded it is showing confirm box
 

function
TextChanged(Sender,EventArgs)
   {
 
       var sSave;
                   
                   var Nametext = $find('<%= radtxtName.ClientID  %>');
 
                   sSave = confirm("Name is changed");
                   alert(sSave);
          if (sSave == true)
          {
              
              var NewValue = EventArgs.get_newValue();
              Nametext .set_value(NewValue);
               
          }
          else   {
 
              var oldValue = EventArgs.get_oldValue();
              Nametext .set_value(oldValue);
             
          }
          
       
  }
<telerik:RadTextBox ID="radtxtName" runat="server" >
   <ClientEvents OnValueChanged="TextChanged" />
    </telerik:RadTextBox>
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
1 answer
48 views
I need to hide edit link after clicking update for a row in grid.
Can this be done?

 

if (e.CommandName == "Update")

 

{

GridEditableItem editedItem = (e.Item as GridEditableItem);
/* do something here*/

 

editedItem.Visible =

false; //not working

 

editedItem.Edit =

false; // not working

 

 

}


Thanks
Princy
Top achievements
Rank 2
 answered on 03 Feb 2011
3 answers
143 views
Hi Guys,
                            I have another issue. Please help me....
Here is my issue. i have RadGrid which has Edit Pop up . And I have RadUPload in the RadGrid on Form Template. When i was trying to save this pdf files on server on click update event. ITs not getting or finding those files.............


Please any help.....
Thanks,Jaru
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
8 answers
174 views
Hello,

I am observing a typical behavior on closing the RadSpell dialog box.

Steps to replicate the issue:
  1. Open the RadSpell dialog box.
  2. Ensure that the text box that it is trying to spell check has at least one invalid text entry (as per the dictionary used).
  3. Now, close the spell check dialog box before it shows the valid suggestions for the incorrect entry (as per the dictionary used).
  4. The browser would then show the following java script error: "Error: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."
I know why this is happening. Reason is simple: The HTML element that the RadSpell is trying to bring focus is no more visible because I closed the dialog box. Please let me know if I can tweak something somewhere to avoid the above thing from happening.

I am using RadControls Q3 2008. I have tried the above scenario on the IE8 browser.

Thanks.
~Abhay
Abhay Jain
Top achievements
Rank 1
 answered on 02 Feb 2011
10 answers
117 views
Hi, 

I'm using version 2010.2.826.40. 

My RadGrid exports work fine until I do a column sort or group. Then, when trying to export, the entire grid simply re-displays itself in the browser.

Here's my code.

Thanks much,
Dan Cogswell

<asp:EntityDataSource ID="edsEmployees" runat="server" ConnectionString="name=dbIT_Entities"
            DefaultContainerName="dbIT_Entities" EnableDelete="false" EnableInsert="False"
            EnableUpdate="False" EntitySetName="ActivePhoneLists" EnableFlattening="False"
            OrderBy="it.LastName, it.FirstName" />
        <asp:EntityDataSource ID="edsDepartments" runat="server" ConnectionString="name=dbIT_EmployeesEntities"
            DefaultContainerName="dbIT_EmployeesEntities" EntitySetName="Departments" EnableFlattening="False" />
        <telerik:RadGrid ID="rgEmployees" Skin="WebBlue" ShowGroupPanel="True" runat="server" DataSourceID="edsEmployees"
            AllowAutomaticDeletes="False" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
            AllowSorting="True" AllowFilteringByColumn="true" AutoGenerateColumns="False"
            GridLines="None" PagerStyle-Position="Top" AllowPaging="true" 
            ClientSettings-Scrolling-AllowScroll="false" ShowStatusBar="true" >
            <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
            <GroupingSettings ShowUnGroupButton="true" />
            <ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true" 
            Pdf-PageLeftMargin=".5in"
            Pdf-PageRightMargin=".5in" Pdf-PageTitle="CMRP Phonebook" Pdf-PageHeight="8.5in" Pdf-PageWidth="11in"
            OpenInNewWindow="true"></ExportSettings>
            <MasterTableView DataKeyNames="EmployeeNumber" GroupLoadMode="Client" CommandItemDisplay="Top" >
                <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" 
                    ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" />
                <HeaderStyle HorizontalAlign="Left" />
                <Columns>
                    <telerik:GridBoundColumn ReadOnly="true" DataField="EmployeeNumber" UniqueName="EmployeeNumber"
                        HeaderText="Employee Num" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ItemStyle-Width="80px"
                        HeaderStyle-Width="80px" FilterControlWidth="50px">
                        <HeaderStyle Width="80px" />
                        <ItemStyle Width="80px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ItemStyle-Width="80px"
                        HeaderStyle-Width="80px" FilterControlWidth="50px">
                        <HeaderStyle Width="80px" />
                        <ItemStyle Width="80px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" ItemStyle-Width="90px"
                        HeaderStyle-Width="90px" FilterControlWidth="50px">
                        <HeaderStyle Width="90px" />
                        <ItemStyle Width="90px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="DeptId" DataField="DeptId" HeaderText="Dept"
                        ItemStyle-Width="60px" HeaderStyle-Width="80px" FilterControlWidth="60px">
                        <FilterTemplate>
                            <telerik:RadComboBox ID="rcbDepartment" DataSourceID="edsDepartments" DataTextField="DeptId"
                                DataValueField="DeptId" AppendDataBoundItems="true" 
                                SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("DeptId").CurrentFilterValue %>'
                                runat="server" OnClientSelectedIndexChanged="DepartmentIndexChanged" Width="60px">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                <script type="text/javascript">
                                    function DepartmentIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("DeptId", args.get_item().get_value(), "EqualTo");
                                    }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" MaxLength="250" ItemStyle-Width="150px"
                        HeaderStyle-Width="150px" FilterControlWidth="110px" ItemStyle-Wrap="false">
                        <HeaderStyle Width="150px" />
                        <ItemStyle Width="150px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Building" HeaderText="Building" ItemStyle-Width="125px"
                        HeaderStyle-Width="125px" FilterControlWidth="85px" ItemStyle-Wrap="false">
                        <HeaderStyle Width="125px" />
                        <ItemStyle Width="125px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Room" HeaderText="Room" ItemStyle-Width="100px"
                        HeaderStyle-Width="100px" FilterControlWidth="60px" ItemStyle-Wrap="false">
                        <HeaderStyle Width="100px" />
                        <ItemStyle Width="100px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CellPhone" HeaderText="CellPhone" ItemStyle-Width="90px"
                        HeaderStyle-Width="90px" FilterControlWidth="50px">
                        <HeaderStyle Width="90px" />
                        <ItemStyle Width="90px" />
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

Daniel
Telerik team
 answered on 02 Feb 2011
2 answers
42 views
Hi,

I have a question regarding to the possibility of Microsoft office upgrade effects on RADcontrol?

We are using the following dll for our editor.
   - RadEditor Version = 5.6.4.0
   - RadSpell.dll Version = 2.6.1.0
We would like to upgrade our Microsoft office from 2003 to 2007.
Does it affect RADContorols?

Should we also retest our RADControl after upgrade or they are not using Microsoft office dlls?

Thank you in adavance,

Maryam
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
119 views

I have to bind to Grid with huge data rows (List<customClsss) without paging.

this is my mission :<..
but when i tried this. the page is not work or too slowly display.
if i try to way to  client binding of web service, is it solve it? 
Daniel
Telerik team
 answered on 02 Feb 2011
12 answers
156 views
I have copied the VB code from the sample on Persisting the Grid state in a session.

however it is giving me compile errors when i try to view it. In Visual Studioacts like it builds but flags an erro on the User Control calling this class.

The Error Reported is
 
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
  
Compiler Error Message: BC30201: Expression expected.
  
Source Error:
  
Line 258:
Line 259:    Private Sub Grid_ColumnCreated(ByVal sender As Object, ByVal e As GridColumnCreatedEventArgs)
Line 260:        Dim colSettings As ColumnSettings = Settings.AutoGeneratedColumnSettings.Find(Function(cs) cs.UniqueName = e.Column.UniqueName)
Line 261:        Dim column As GridColumn = e.Column
Line 262:
  
  
Source File: C:\Documents and Settings\ddownie\My Documents\SasquatchV11\App_Code\GridSettingsPersister.vb    Line: 260

on this fuction:
Private Sub Grid_ColumnCreated(ByVal sender As Object, ByVal e As GridColumnCreatedEventArgs)
    Dim colSettings As ColumnSettings = Settings.AutoGeneratedColumnSettings.Find(Function(cs) cs.UniqueName = e.Column.UniqueName)
    Dim column As GridColumn = e.Column
    If colSettings IsNot Nothing Then
        SetColumnSettings(column, colSettings)
    End If
End Sub

can anyone see what i might have to change or is there an update for this call file ?

David
Top achievements
Rank 1
 answered on 02 Feb 2011
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?