Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
132 views
Dear All,

I am using the Rad Grid for AJAX. 

In that I have bounded the selected index change event, but it is not firing.

My designer code is:

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
        Skin="Office2007" AutoGenerateColumns="false" GroupingEnabled="False" PageSize="5"
        ShowStatusBar="True" AllowMultiRowSelection="true">
        <PagerStyle Mode="Slider" />
        <MasterTableView NoDetailRecordsText="No Versions Found." NoMasterRecordsText="No Documents Found."
            HierarchyLoadMode="Client">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
        </MasterTableView>
        <ClientSettings AllowDragToGroup="True" AllowColumnHide="True" AllowColumnsReorder="True"
            ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />
            <Resizing AllowColumnResize="True" />
        </ClientSettings>
        <FilterMenu EnableTheming="True" Skin="Office2007">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu>


Can any one help me in this regard?

Thanks a lot in advance.
Shinu
Top achievements
Rank 2
 answered on 12 Nov 2008
2 answers
268 views
Hi,

I am using a RadGrid control within a Sharepoint webpart. The width of the grid is set to 100% of the web part. The width of each column is set to a fixed percentage so that they all add up to 100%. Is is possible that columns could have a minimum size so that grids do not shrink smaller than a predefined size.  Also is it possible that the columns be allowed to grow and shrink depending on the webpart zone that they are in?

Thanks
Vedanshu
Neda
Top achievements
Rank 1
 answered on 12 Nov 2008
1 answer
124 views
In my grid I have a drop down column

<telerik:GridDropDownColumn UniqueName="ddlArtistType" DataField="ArtistType" ListTextField="ArtistType" ListValueField="ArtistType" 
                                        ListDataMember="ArtistType" HeaderText="Artist Type" DropDownControlType="RadComboBox" /> 



When I run the page and add a new row, the items in the drop down list selection are taken from the underlying grid datasource not its own separate datasource (so many items in the dropdown are dupliacted)

I need to assign a totally separate datasource in order to pick one of the items to enter into the underlying column in the grid

Using the above method doesnt seem to make sense since when would you ever use the grid as a datasource for the dropdown, they are usually a totally different dataset

Ive tried this
<telerik:GridDropDownColumn UniqueName="ddlArtistType" DataField="ArtistType" HeaderText="Artist Type" DropDownControlType="RadComboBox" /> 



 and trying to populate in the ItemDataBound event, but the row always shows up empty

So how can I use a GridDropDownColumn and assign its own datasource at runtime in my code behind ?

** Im not using a datatable as the grid datasource, im using a custom collection so ListDatamember would have no effect
Princy
Top achievements
Rank 2
 answered on 12 Nov 2008
2 answers
158 views
Hi Guys,
               I have a scenario where I want to show a set of questions in which each questions is of different type say Single selection (radio btn),Multiple choice (chkbox), Text, Ranking etc. I want to show them in a single page and collect the information in onclick. Can some one suggest me best possible control or way of doing this?

Things that I have tried

1) In RadGrid with one colum and having diffenrent type of UI in panels  inside Templatecolum. And manipulating the visibility of the each panel in ItemCreated and ItemBound events for different type of questions coming from the data. That is my gird in aspx look like this
              

 

<MasterTableView Width="70%" AutoGenerateColumns="False" NoMasterRecordsText="No Product Exists">

 

 

<Columns>

 

 

    <telerik:GridTemplateColumn UniqueName="Question">

 

 

        <ItemTemplate>

 

 

                <asp:Panel ID="pnlSimpleTxt" runat="server" BackColor="Aqua" Height="50px" Width="125px">

 

 

                        <asp:Literal ID="Question1" runat="server"></asp:Literal>

 

 

                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

 

 

                </asp:Panel>

 

 

               <asp:Panel ID="pnlMultiChoice" runat="server" BackColor="Bisque" Height="50px" Width="125px">

 

 

                        <asp:Literal ID="Question2" runat="server"></asp:Literal>

 

 

                        <asp:CheckBox ID="CheckBox1" runat="server" />
                        <asp:CheckBox ID="CheckBox2" runat="server" />

 

 

                </asp:Panel>

 

 

                <asp:Panel ID="pnlSingleSelect" runat="server" Height="50px" Width="125px">

 

 

                        <asp:Literal ID="Question3" runat="server"></asp:Literal>

 

 

                        <asp:DropDownList ID="ddlAnswerOptions" runat="server">

 

 

                        </asp:DropDownList>

 

 

                </asp:Panel>

 

 

        </ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

Though it is working, I am not ok with this crude way of doing it.  Is there any other good solution for this?

Thanks for you help !!
ms

ms
Top achievements
Rank 1
 answered on 12 Nov 2008
3 answers
102 views
I have a situation where I'd like to display, in the exported Excel spreadsheet, several columns which have a style of "display:none". Is this possible and how would one go about this?

example:

 

<telerik:GridBoundColumn DataField="acct_first_name" HeaderText="First Name" Display="false" UniqueName="acct_first_name" />

Or, how would I display each data item in a GridTemplateColumn as a separate cell in Excel once it's exported?
example:
<telerik:GridTemplateColumn UniqueName="Acct_full_address"><HeaderTemplate>
<div id="Div2" runat="server"> Full Address</div>
</HeaderTemplate>
<ItemTemplate>
<div>

<%# Eval("acct_first_name") %><%# Eval("acct_last_name") %>

</div>
<div>
<%# Eval("acct_addr1") %><%# Eval("acct_addr2") %><%# Eval("acct_unit_number") %>

</div>
<div>
<% # Eval("acct_city") %>,<% # Eval("acct_state") %> <%# Eval("acct_postalcode") %><%# Eval("acct_country_code") %>

</div>
</ItemTemplate>
</telerik:GridTemplateColumn>

 

Any help would be much appreciated.

 

Shinu
Top achievements
Rank 2
 answered on 12 Nov 2008
3 answers
156 views
I have a Grid that allows users to enter numbers in all the rows and displays the totals at the bottom. To achieve this I used a GridTemplateColumn with RadNumericTextBox textbox in it. It itemtemplate is shown below 
<ItemTemplate>
            <telerik:RadNumericTextBox ID="Number" runat="server" MinValue="0" MaxValue="1800000000" NumberFormat-AllowRounding="true" Width="90px" NumberFormat-DecimalDigits="0" Skin="Office2007" OnTextChanged="Number_TextChanged" AutoPostBack="true"></telerik:RadNumericTextBox>
</ItemTemplate>

On the textchanged event I loop through all the rows and calculate the total at follows

foreach (GridDataItem gr in radGrid1.MasterTableView.Items)
            {
                RadNumericTextBox Number = (RadNumericTextBox)gr.FindControl("Number");
                lTotal += long.Parse(Math.Round(Number.Value.Value, 0).ToString());
            }

and then I display it in the footer as follows:

radGrid1.MasterTableView.Columns[8].FooterText = string.Format("{0:0,000}",lTotal );

This does not update the footer text. Please help.


Shinu
Top achievements
Rank 2
 answered on 12 Nov 2008
5 answers
424 views
I am trying to export my grid using LinkButton's in the CommandItemTemplate, but unfortunately it is not working.  I have tried setting the OnClick="LinkButton1_Click" but it does not seem to be working.

I have also tried to FindControl during the RadGrid1_ItemCreated event, but then I cannot set the OnClick property from there since it is Protected...

Any suggestions would be great
    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)  
        RadGrid1.ExportSettings.ExportOnlyData = True 
        RadGrid1.MasterTableView.ExportToExcel()  
    End Sub 
 
    Protected Sub LinkButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs)  
        RadGrid1.MasterTableView.ExportToPdf()  
    End Sub 
 
    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated  
        If (TypeOf e.Item Is GridCommandItem) Then 
            Dim cmditm As GridCommandItem = DirectCast(e.Item, GridCommandItem)  
            Dim LinkButton1 As LinkButton = DirectCast(cmditm.FindControl("LinkButton1"), LinkButton)  
            Dim LinkButton2 As LinkButton = DirectCast(cmditm.FindControl("LinkButton2"), LinkButton)  
 
            LinkButton1.OnClick = LinkButton1_Click()  
        End If 
    End Sub 

<div class="panelbody_bottom">  
    <div style="height: 20px;">&nbsp;</div> 
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" Skin="Telerik" AllowAutomaticDeletes="false" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowSorting="true" AllowPaging="true">  
        <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true">  
            <Excel Format="HTML" /> 
            <Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous" Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" PageTitle="My Businesses For Sale" 
                Subject="My Businesses For Sale" Title="My Businesses For Sale" PaperSize="Letter" /> 
        </ExportSettings> 
        <MasterTableView TableLayout="Auto" DataKeyNames="ID" CommandItemDisplay="Top">  
            <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" /> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="15px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="15px" /> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="_31" HeaderText="Broker/Agent" UniqueName="31" /> 
                <telerik:GridBoundColumn DataField="_45" HeaderText="Business Extension" UniqueName="45" /> 
                <telerik:GridBoundColumn DataField="_59" HeaderText="Description" UniqueName="59" /> 
                <telerik:GridBoundColumn DataField="_118" HeaderText="Selling Price" UniqueName="_118" DataFormatString="{0:c}" /> 
                <telerik:GridTemplateColumn DataField="DateExpires" HeaderText="Expires" UniqueName="DateExpires">  
                    <ItemTemplate> 
                        <asp:Label ID="lblDateUpdated" runat="server" Text='<%# FormatDate(DataBinder.Eval(Container.DataItem, "DateExpires"), DataBinder.Eval(Container.DataItem, "OrderID")) %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="AdHits" HeaderText="Views" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" UniqueName="AdHits" /> 
                <telerik:GridTemplateColumn DataField="ID" HeaderText="" UniqueName="Edit">  
                    <ItemTemplate> 
                        <a href='#'>edit</a> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="ID" HeaderText="" UniqueName="Sold">  
                    <ItemTemplate> 
                        <a href='#'>sold</a> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <CommandItemTemplate> 
                <div style="float: left; display: inline; padding-left: 5px;"><a href="PostAd.aspx">post new business for sale ad</a></div>  
    <div style="float: right; display: inline; padding-right: 5px;">  
        <asp:LinkButton ID="LinkButton1" runat="server" Text="export to excel" /> 
        &nbsp;|&nbsp;  
        <asp:LinkButton ID="LinkButton2" runat="server" Text="export to pdf" /> 
    </div> 
            </CommandItemTemplate> 
        </MasterTableView> 
        <StatusBarSettings LoadingText="Loading..." /> 
    </telerik:RadGrid> 
</div> 
Chase Florell
Top achievements
Rank 1
 answered on 12 Nov 2008
9 answers
498 views
Hi Guys,

How can use RadStyleSheetManager with my own stylesheets. I mean, I want to use the RadStyleSheetManager feature to gzip and combine my own stylesheet.

Thanks!

Shane
Shane
Top achievements
Rank 1
 answered on 11 Nov 2008
6 answers
175 views
I posted a message asking where the 'my posts' section of the forums were, you replied (by email) asking me to look at the attached screenshot.  Because I dont know where my posts are I cant look at the attached screenshot to see where my posts are !
Levi
Top achievements
Rank 1
 answered on 11 Nov 2008
14 answers
341 views
The new site is (as we say in Canada) beauty, eh!

So let's say that I own some Sitefinity licenses (which I do) and I like pretty much most of the customization work that you've done for the new telerik.com site.  Is there any chance you guys kept track of all the work you had to do to make your own site work well with Sitefinity and you'd like to pass that info on to us in the form of a blog series?  Sitefinity itself is a great product, and its documentation has come a long ways, but it's still tricky to get it to work as expected sometimes.  Personally, I'd like to see how you guys were able to take your existing forums and integrate them into Sitefinity - in particular I'd like to know if you're using any of the standard Sitefinity Forums controls for this.

If you did build any custom controls for the pages on the telerik.com site, is there any chance you can make these available to your loyal SItefinity users to see how the "pros" took a real-world situation and made it work with Sitefinity?  That would be just super, particularly since alot of people will have been familiar with the old telerik site and would be very interested to know how you made the transfer to the new site.

Again, the new layout is much better than before and kudos for the Q3 release in general.  It's been probably the smoothest release I've witnessed over the past 3 years.  Thanks

Shaun
PureCode
Top achievements
Rank 2
 answered on 11 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?