Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
232 views
Hello,

I am facing lot of problem creating GridTemplateColumn dynamically, i tried it using implementing ITemplate interface but was not successful.

I have other columns too in grid, which i create dynamically and do databinding also dynamically which works perfect,

Please can someone help me through this, its urgent.

Thanks in advance!

with regards,
Peeyush pandey
<telerik:GridTemplateColumn AllowFiltering="False" UniqueName="columnAction"  >
    <HeaderStyle Width="30px" />
    <HeaderTemplate>
        <asp:Label ID="lblHeaderAction" runat="server" Text="Action"></asp:Label>
    </HeaderTemplate>
    <ItemTemplate>
        <asp:Panel ID="editButtonPanel" runat="server" CssClass="custom-Action-column" Width="50px">
            <asp:ImageButton ID="TagCloudButton" runat="server"  Width="15px"
                Height="15px" CommandName="TagCloud"   CausesValidation="False" ImageUrl="~/images/icon_grid.gif" />
        </asp:Panel>
    </ItemTemplate>
</telerik:GridTemplateColumn>
 
 
 <telerik:GridTemplateColumn AllowFiltering="False" UniqueName="ProfileImage"  >
    <HeaderStyle Width="50px" />
    <HeaderTemplate>
        <asp:Label ID="lblHeaderActionImage" runat="server" Text="Image"></asp:Label>
    </HeaderTemplate>
    <ItemTemplate>
     <asp:Panel ID="ImagePanelPos" runat="server" CssClass="custom-Action-column" Width="50px">
        <asp:Image ID="Image1" runat="server" Height="35px" Width="35px" ImageUrl='<%#Convert.ToString(Eval("Url")) %>' />
        </asp:Panel>
    </ItemTemplate>
</telerik:GridTemplateColumn>
 
Shinu
Top achievements
Rank 2
 answered on 06 Dec 2012
1 answer
142 views
How to access RadListBox header Templet elements in server side and  in ItemDataBound?
Princy
Top achievements
Rank 2
 answered on 06 Dec 2012
3 answers
81 views

Hello,

i have a GridDropDownColumn connected to a DataSource and i get an error when i try to set the ListTextField property like this: ListTextField = "Field1, Field2". How can i achieve this programmatically in radgrid view mode?

I have written the following code to achieve this in radgrid edit mode:

if (e.Item is GridEditableItem && e.Item.IsInEditMode)
       {
 
           GridEditableItem editItem = (GridEditableItem)e.Item;
 
           RadComboBox combo = (RadComboBox)editItem["Field1"].Controls[0];
 
           combo.ItemDataBound += new RadComboBoxItemEventHandler(combo_ItemDataBound);
 
       }
 
   void combo_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
   {
       RadComboBoxItem item = (RadComboBoxItem)e.Item;
 
       DataRowView dr = (DataRowView)e.Item.DataItem;
 
       item.Text = item.Text + " ( " + dr["Field2"].ToString() + " " + dr["Field3"].ToString() + " ) ";
 
   }

Thank you very much.

Princy
Top achievements
Rank 2
 answered on 06 Dec 2012
1 answer
116 views
Hi

I have inherited a site with a lot of Telerik components, and I'm having trouble with adding a PageSizeComboBox to a RadGrid. 

For some reason the ComboBox doesn't show. How can I get it to show itself? 

<telerik:RadGrid ID="ListView_RadGrid" runat="server"
    OnPreRender="ListView_RadGrid_OnPreRender"
    EnableViewState="True"
    GridLines="None"
    TabIndex="5"
    AllowPaging="True"
    AllowSorting="True"
    OnSortCommand="ListView_RadGrid_SortCommand"
    OnDataBound="ListView_RadGrid_DataBound"
    OnDataBinding="ListView_RadGrid_DataBinding"
     
    OnPageIndexChanged="ListView_RadGrid_PageIndexChanged"
    OnNeedDataSource="ListView_RadGrid_OnNeedDataSource"
    OnRowDrop="ListView_RadGrid_OnRowDrop"
    AllowMultiRowSelection="True" 
    ShowDesignTimeSmartTagMessage="True"
    AllowCustomPaging="True"
    OnPageSizeChanged="ListView_RadGrid_PageSizeChanged"
     
>
    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom"  ShowPagerText="True" AlwaysVisible="True"   />
 
    <MasterTableView ShowHeader="true" AllowMultiColumnSorting="false" AutoGenerateColumns="False"
        EnableViewState="False" ClientDataKeyNames="ObjectId,Status" DataKeyNames="ObjectId" >
        <CommandItemSettings ExportToPdfText="Export to Pdf"  />
    </MasterTableView>
</telerik:RadGrid>

Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Dec 2012
1 answer
137 views
Unlike a GridTextBoxColumnEditor (which works), the CssClass on the TextBoxStyle for the GridDateTimeColumnEditor doesn't work - the class isn't applied on the "input" box. Can anyone please confirm?

<telerik:GridDateTimeColumn PickerType="DatePicker" DataField="InstallationDate" FilterControlAltText="Filter Install Date" HeaderText="Install Date" SortExpression="InstallationDate" UniqueName="InstallationDate" ReadOnly="false" AllowFiltering="true" MaxLength="50" ColumnEditorID="gceSmallDateBox">
                                    </telerik:GridDateTimeColumn>


<telerik:GridDateTimeColumnEditor runat="server" ID="gceSmallDateBox">
                            <TextBoxStyle CssClass="smallTextBox" />
                        </telerik:GridDateTimeColumnEditor>

Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Dec 2012
6 answers
165 views
We're using a GridAttachmentColumn to upload stuff within a databound Grid.

How can I hide this column in View mode and only display it when an item is in Edit mode? We also use InPlace editing and I suppose we would need to rebind the grid. Possible to hide the column via JavaScript?
Peter
Top achievements
Rank 1
 answered on 06 Dec 2012
2 answers
105 views
Hi,

I use RadWindow throughout my application.
I typically close the window in code behind using winPDF.VisibleOnPageLoad = false; and this works just fine.
However, if I'm using the following code to cause a file to be downloaded to the client, then the RadWindow remains open:

Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + fullfilename + "\"");
Response.TransmitFile(fullfilename);
 
winPDF.VisibleOnPageLoad = false; // Close the RadWindow

Placing the last line above before the Response. statements has no effect.
I have tried adding  OnClientClicked="closePDF();return false;" to the RadButton on the RadWindow that performs the export, but that results in an error since the function can't seem to find the window.  My idea was to cause the window to close and then the postback to occur to cause the above code behind to fire.  Here's the relevant code in my aspx page:

function closePDF() {
 
                var window = $find("ctl00_ContentPlaceHolder_winPDF");
                window.close();
            }
 
<telerik:RadWindow ID="winPDF" Width="300px" Height="240px" runat="server" Title="Export to PDF" Style="z-index: 999999"
                VisibleOnPageLoad="false" Behaviors="Move" EnableShadow="true" Modal="true" OnClientClose="OnClientClose">
                <ContentTemplate>
                    <div style="padding: 5px;">
                        <telerik:RadButton ID="btnEx2PDF" OnClick="Export2PDF" CommandName="Export" Text="Export" OnClientClicked="closePDF();return false;"
                            runat="server">
                        </telerik:RadButton>
                        <telerik:RadButton ID="btnCancel" OnClick="Export2PDF" CommandName="Cancel" Text="Cancel"
                            CausesValidation="false" runat="server">
                        </telerik:RadButton>
                    </div>
...

When the application is run, the "window" variable in the above function is null.
If I remove the OnClientClicked event from the RadButton, I get no errors, but the RadWindow will not close.

Any ideas?

Thanks in advance

Jim
jlj30
Top achievements
Rank 2
 answered on 05 Dec 2012
2 answers
53 views
I have an extremely simple radwindow, called as follows: 
     var oWnd = window.radopen(url, "title");
     oWnd.show();

Once in the window I want to be able to close it simply by hitting the Esc key.  

I have this code, essentially pieced together from various threads.  :
The code below works, but only if I click within the body of the RadWindow first or, if on load, I set the focus to a control within the body.

 Anything particularly wrong with this?

   $(window).ready(function () {
            // Handler for .ready() called.
            $(window).keydown(function (e) {              
                // ESCAPE key pressed
                if (e.keyCode == 27) {                  
                    var oWnd = GetRadWindow();
                    oWnd.close();
                }
            });
   });

function closeWindow() {
            var oWnd = GetRadWindow();
            oWnd.close();
        }
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
Boris
Top achievements
Rank 1
 answered on 05 Dec 2012
2 answers
460 views
Tried to add a RadGrid using the version of Ajax controls I downloaded yesterday and when I try to change the theme, I get the "No Skins Assembly Found" error.  I added a reference to the Telerik.Wec.UI.Skins to my project, closed the solution and reopened it and I am still getting the error.  I have included screenshots of the error and my references folder below.
Gary
Top achievements
Rank 1
 answered on 05 Dec 2012
2 answers
81 views
Hi,
Grid losses while exporting. Pl's help me.

Thanks & Regards
Anzar.M
Manuel Buendia
Top achievements
Rank 1
 answered on 05 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?