Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
73 views
Hello,

          I need Recurrence control  on Button click without scheduler. Which will pop up on button click.   Is there any way to do this. If yes then let me know with sample code.



Thanks
Regards
Rahul
Rahul
Top achievements
Rank 1
 answered on 08 Dec 2010
2 answers
108 views
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
rev1Sum += CorrectlyParseString((dataItem["Rev1"].FindControl("Rev1Label") as Label).Text.ToString());
}
else if (e.Item is GridFooterItem)
GridFooterItem footer = (GridFooterItem)e.Item;
(footer["Rev1"].FindControl("Rev1Total") as RadNumericTextBox).Value = Double.Parse(rev1Sum.ToString());
}
}
when I'm exporting to Excel, it gives me Object reference not set to an instance of an object
Rev1 is GridTemplateColumn
Ramy Mahrous
Top achievements
Rank 1
 answered on 08 Dec 2010
18 answers
528 views
t looks like the only content that is to be displayed in RadWindow is the content of a page that is specified in NavigateURL. That is a problem for me because what I want to display is the dynamic content that I show on the same page on which the rad window is defined.

Is it possible to display the content on the same page defined in the rad window detailsvew?
Neerav
Top achievements
Rank 1
 answered on 08 Dec 2010
2 answers
155 views

I have a RadGrid that has a DataList inside of each row. 
The DataList has checkboxes in them. 

Example:
Let's say the grid has four rows, and the datalist inside each row has three rows itself. 

When a user checks one of the checkboxes in the datalist, I need the same checkbox in the the other three rows with the same value to get checked.  Would it be easier for me to do it client side or server side?  Also, any help to achieve this would be great.
Here a sample of the code:

<telerik:GridTemplateColumn HeaderText="Optional Languages" HeaderStyle-Width="100%" ItemStyle-HorizontalAlign="Left" Groupable="false">
   <ItemTemplate>
   <asp:DataList ID="DataListl" OnItemDataBound="DataList1_ItemDataBound" RepeatLayout="Table" Width="100%" ItemStyle-BorderStyle="None" runat="server">
    <ItemTemplate>
            <asp:CheckBox ID="CheckboxOptional1" runat="server" />                                   
            <asp:Literal ID="LiteralOptional1" Visible="false" runat="server" />
         </ItemTemplate>
      </asp:DataList>
   </ItemTemplate>
</telerik:GridTemplateColumn>
Mike
Top achievements
Rank 1
 answered on 08 Dec 2010
2 answers
442 views
I'm trying to create a single icon button to launch a lookup window. I want the button to match the calendar popup button (Default skin) that can be viewed on this demo: http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/custompopup/defaultcs.aspx.

I tried creating a RadButton with an icon element (and no text property) but it still has a space to the right of the button (and has the button background whereas the calendar background is transparent until rollover). Any suggections?  
<telerik:RadButton ID="RadButton1" runat="server" >
    <Icon PrimaryIconUrl="images/icons/find.png" />
</telerik:RadButton>
 

 

 

 

 

 

 

 

Richard
Top achievements
Rank 1
 answered on 08 Dec 2010
4 answers
263 views
I followed the example found in your documentation at the link below on programmatically creating template columns.

http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html#Creating_template_columns_programmatically


This works great for the initial data binding of the grid.  However, on a subsequent postback when I call Rebind the output for the column with custom item template is blank.  When I use the debugger to step through the NeedDataSource event handler it appears the custom item template is no longer associated with the column.  The ItemTemplate property on the column is now null. 

I followed the recommendation to add the new column to the collection before setting properties. 

templateColumn = new GridTemplateColumn();
rgPlans.Columns.Add(templateColumn);
templateColumn.HeaderText = "Custom Column";
templateColumn.ItemTemplate = new CustomFieldTemplate("MyCustomId");

Other non-template columns on my grid which I created dynamically seem to retain their settings.

Any ideas on why the column item template was lost?

Thanks
John
Top achievements
Rank 1
 answered on 08 Dec 2010
5 answers
87 views
Hello. I'm trying to achieve the following look: The column columnUserName needs to be grouped and for all the counties that relates to a user, he should be repeated just once. I need the group NOT expanded. I also want the user NOT able to make any visual changes i.e. change grouping at run-time. Thanks.

<fieldset id="fieldsetCountyAssignments" style="width: 868px">
              <legend>
                County Assignments:
              </legend>
              <telerik:RadGrid ID="RadGridCountyAssignments2" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                GridLines="None" Skin="Office2007" SkinID="RadGrid_UnPageable" DataSourceID="LinqDataSourceAssignedCounties"
                ShowGroupPanel="True">
                <MasterTableView DataKeyNames="OID" DataSourceID="LinqDataSourceAssignedCounties" GroupsDefaultExpanded="true">
                  <Columns>
                    <telerik:GridBoundColumn DataField="UserName" HeaderText="User" UniqueName="columnUserName"  />
                    <telerik:GridBoundColumn DataField="CountyName" HeaderText="County" UniqueName="columnCountyName" Groupable="False" />
                  </Columns>
                  <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                      <SelectFields>
                        <telerik:GridGroupByField FieldName="UserName" />
                      </SelectFields>
                      <GroupByFields>
                        <telerik:GridGroupByField FieldName="UserName" />
                      </GroupByFields>
                    </telerik:GridGroupByExpression>
                  </GroupByExpressions>
                </MasterTableView>
                <ClientSettings AllowDragToGroup="True">
                </ClientSettings>
              </telerik:RadGrid>
              <asp:Button ID="ButtonModifyAssignments" runat="server" OnClick="ButtonModifyAssignments_Click" Text="Modify Assignments" />
            </fieldset>
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 08 Dec 2010
3 answers
250 views
Hi,

1) I have a RadGrid with MasterTableView and DetailTables. There are many columns in DetailTables and because of this the last column will not be shown fully. I want the Horizontal scroll to appear so that we can see the last column properly. I have added the code <Scrolling AllowScroll="True" ScrollHeight="50px" UseStaticHeaders="true" />  but still the Horizontal scroll is not appearing. How to achieve this?

2) If I enter data in textbox (in RadGrid) and go to Page 2 and come back again to Page 1, the data entered in Page 1 will be lost. I want to retain the values in the grid after Paging. How to retain the data after pagination?

The browser I am using is IE8.

I have also attached the code and screenshot. Please provide the solution for the queries.

<telerik:RadGrid ID="rgCostBasisInquiry" runat="server" AllowMultiRowSelection="false" AllowPaging="true" OnPreRender="rgCostBasisInquiry_PreRender"
                                ShowHeader="true" AutoGenerateColumns="False" loadingtemplatetransparency="25"
                                OnNeedDataSource="rgCostBasisInquiry_NeedDataSource" Width="750px" OnItemDataBound="rgCostBasisInquiry_ItemDataBound"
                                OnDetailTableDataBind="rgCostBasisInquiry_DetailTableDataBind" GridLines="None"
                                AllowSorting="True" Height="220px" AlternatingItemStyle-BackColor="AliceBlue"
                                Skin="Office2007">
                                <AlternatingItemStyle BackColor="AliceBlue"></AlternatingItemStyle>
                                <MasterTableView TableLayout="Fixed" Name="CBInquiryGrid" DataKeyNames="SecurityMasterID" EnableNoRecordsTemplate="true" >
                                    <PagerStyle Mode="NextPrevAndNumeric" Visible="true" />
                                    <NoRecordsTemplate>
                                        <div>No records to display</div>
                                    </NoRecordsTemplate>
                                    <ParentTableRelation>
                                        <telerik:GridRelationFields DetailKeyField="SecurityMasterID" MasterKeyField="SecurityMasterID" />
                                    </ParentTableRelation>
                                    <DetailTables>
                                        <telerik:GridTableView AllowPaging="false" Name="gtvCBInquiryChildGrid" runat="server"
                                            ShowHeader="true" Width="100%" >
                                            <RowIndicatorColumn>
                                                <HeaderStyle Width="5px"></HeaderStyle>
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn>
                                                <HeaderStyle Width="5px"></HeaderStyle>
                                            </ExpandCollapseColumn>
                                            <Columns>
                                                <telerik:GridTemplateColumn DataField="SecurityMasterID" HeaderButtonType="TextButton" HeaderText="SecurityMasterID"
                                                    SortExpression="SecurityMasterID" UniqueName="SecurityMasterID" Visible="false">
                                                    <HeaderStyle HorizontalAlign="left" Width="0px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:Label runat="server" ID="lblSecurityMasterID" Text='<%# DataBinder.Eval(Container.DataItem, "SecurityMasterID")%>'></asp:Label>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn DataField="ParentLotID" HeaderButtonType="TextButton" HeaderText="ParentLotID"
                                                    SortExpression="ParentLotID" UniqueName="ParentLotID" Visible="false">
                                                    <HeaderStyle HorizontalAlign="left" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:Label runat="server" ID="lblParentLotID" Text='<%# Convert.ToInt64(DataBinder.Eval(Container.DataItem, "ParentLotID"))%>'></asp:Label>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn DataField="TradeNumber" HeaderButtonType="TextButton" HeaderText="Trade #"
                                                    SortExpression="TradeNumber" UniqueName="TradeNumber" >
                                                    <HeaderStyle HorizontalAlign="center" Width="30px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="hlTradeNumber" Font-Underline="true" ForeColor="Blue" ToolTip="Click here to view Cost Basis Detail screen"
                                                            runat="server" Text='<%# ((DataBinder.Eval(Container.DataItem, "TradeNumber") == null) || (DataBinder.Eval(Container.DataItem, "TradeNumber") == "")) ? " " : DataBinder.Eval(Container.DataItem, "TradeNumber")%>'></asp:LinkButton>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn DataField="TaxLotID" HeaderButtonType="TextButton" HeaderText="Lot ID"
                                                    SortExpression="TaxLotID" UniqueName="TaxLotID">
                                                    <HeaderStyle HorizontalAlign="center" Width="30px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="hlLotID" Font-Underline="true" ForeColor="Blue" ToolTip="Click here to view Cost Basis Detail screen"
                                                            runat="server" Text='<%#Convert.ToInt64(DataBinder.Eval(Container.DataItem, "TaxLotID")) %>'></asp:LinkButton>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                               <telerik:GridTemplateColumn DataField="MatchedLotID" HeaderButtonType="TextButton" HeaderText="Matched Lot ID"
                                                    SortExpression="MatchedLotID" UniqueName="MatchedLotID">
                                                    <HeaderStyle HorizontalAlign="center" Width="44px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="hlMatchedLotID" Font-Underline="true" ForeColor="Blue" ToolTip="Click here to view Cost Basis Detail screen"
                                                            runat="server" Text='<%#Convert.ToInt64(DataBinder.Eval(Container.DataItem, "MatchedLotID")) %>'></asp:LinkButton>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="TradeDate" HeaderButtonType="TextButton" HeaderText="Trade Date"
                                                    SortExpression="TradeDate" UniqueName="TradeDate">
                                                    <HeaderStyle HorizontalAlign="center" Width="50px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn DataField="TradeType" HeaderButtonType="TextButton" HeaderText="Trade Type"
                                                    SortExpression="TradeType" UniqueName="TradeType" >
                                                    <HeaderStyle HorizontalAlign="center" Width="54px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:Label runat="server" ID="lblTradeType" Text='<%# DataBinder.Eval(Container.DataItem, "TradeType")%>'></asp:Label>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="Quantity" HeaderButtonType="TextButton" HeaderText="Qty"
                                                    SortExpression="Quantity" UniqueName="Quantity">
                                                    <HeaderStyle HorizontalAlign="center" Width="33px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Price" HeaderButtonType="TextButton" HeaderText="Price"
                                                    SortExpression="Price" UniqueName="Price">
                                                    <HeaderStyle HorizontalAlign="center" Width="33px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="MarketValue" HeaderButtonType="TextButton" HeaderText="Market Value"
                                                    SortExpression="MarketValue" UniqueName="MarketValueChld">
                                                    <HeaderStyle HorizontalAlign="center" Width="45px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn DataField="CostBasis" HeaderButtonType="TextButton" HeaderText="Cost Basis"
                                                    SortExpression="" UniqueName="CostBasis">
                                                    <HeaderStyle HorizontalAlign="center" Width="36px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <telerik:RadNumericTextBox ID="txtCostBasis" Font-Size="xx-small" runat="server"
                                                            Width="95%" Value='<%# Convert.ToDecimal(DataBinder.Eval(Container.DataItem, "CostBasis"))%>'>
                                                        </telerik:RadNumericTextBox>
                                                        <asp:HiddenField ID="hdnCostBasisChldHdnChanged" runat="server" Value="0" />
                                                        <asp:HiddenField ID="hdnCostBasisChldHdn" runat="server" Value='<%# Convert.ToDecimal(DataBinder.Eval(Container.DataItem, "CostBasis"))%>' />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="UnrealisedGainLoss" HeaderButtonType="TextButton"
                                                    HeaderText="Unrealized Gain/Loss" SortExpression="UnrealisedGainLoss" UniqueName="UnrealisedGainLoss">
                                                    <HeaderStyle HorizontalAlign="center" Width="51px"/>
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="RealisedGainLoss" HeaderButtonType="TextButton"
                                                    HeaderText="Realized Gain/Loss" SortExpression="RealisedGainLoss" UniqueName="RealisedGainLoss">
                                                    <HeaderStyle HorizontalAlign="center" Width="47px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="GainLossTerm" HeaderButtonType="TextButton" HeaderText="Term"
                                                    SortExpression="GainLossTerm" UniqueName="GainLossTerm">
                                                    <HeaderStyle HorizontalAlign="center" Width="25px"/>
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="ClosedDate" HeaderButtonType="TextButton" HeaderText="Closed Date"
                                                    SortExpression="ClosedDate" UniqueName="ClosedDate">
                                                    <HeaderStyle HorizontalAlign="center" Width="50px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Gifted/Inherited" HeaderButtonType="TextButton" HeaderText="Gifted"
                                                    SortExpression="Gifted" UniqueName="Gifted">
                                                    <HeaderStyle HorizontalAlign="center" Width="29px" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn DataField="Action" HeaderButtonType="TextButton" HeaderText="Action"
                                                    SortExpression="Action" UniqueName="Action">
                                                    <HeaderStyle HorizontalAlign="center" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="hlAction" Font-Underline="true" ForeColor="Blue" ToolTip="Click here to view Update Lot screen"
                                                            runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Action") %>'></asp:LinkButton>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <RowIndicatorColumn>
                                        <HeaderStyle Width="5px"></HeaderStyle>
                                    </RowIndicatorColumn>
                                    <ExpandCollapseColumn Visible="True">
                                        <HeaderStyle Width="5px"></HeaderStyle>
                                    </ExpandCollapseColumn>
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="SecurityMasterID" HeaderButtonType="TextButton"
                                            Visible="false" HeaderText="SecurityMasterID" SortExpression="SecurityMasterID"
                                            UniqueName="SecurityMasterID">
                                            <HeaderStyle HorizontalAlign="left" Width="0%" />
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn DataField="Symbol" HeaderButtonType="TextButton" HeaderText="Symbol"
                                            SortExpression="Symbol" UniqueName="Symbol">
                                            <HeaderStyle HorizontalAlign="center" Width="70px" />
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblSymbol" Text='<%# DataBinder.Eval(Container.DataItem, "Symbol")%>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="CUSIP" HeaderButtonType="TextButton" HeaderText="CUSIP"
                                            SortExpression="CUSIP" UniqueName="CUSIP">
                                            <HeaderStyle HorizontalAlign="center" Width="70px" />
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblCUSIP" Text='<%# DataBinder.Eval(Container.DataItem, "CUSIP")%>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="Description" HeaderButtonType="TextButton"
                                            HeaderText="Description" SortExpression="Description" UniqueName="Description">
                                            <HeaderStyle HorizontalAlign="center" Width="160px" />
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblDescription" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="SecurityType" HeaderButtonType="TextButton"
                                            HeaderText="Sec.Type" SortExpression="SecurityType" UniqueName="SecurityType">
                                            <HeaderStyle HorizontalAlign="center" Width="55px" />
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblSecurityType" Text='<%# DataBinder.Eval(Container.DataItem, "SecurityType")%>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn DataField="Quantity" HeaderButtonType="TextButton" HeaderText="Qty"
                                            SortExpression="Quantity" UniqueName="Quantity">
                                            <HeaderStyle HorizontalAlign="center" Width="60px"/>
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="MarketValue" HeaderButtonType="TextButton" HeaderText="Market Value"
                                            SortExpression="MarketValue" UniqueName="MarketValueParent">
                                            <HeaderStyle HorizontalAlign="center" Width="60px"/>
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn DataField="UnRealisedGainLoss" HeaderButtonType="TextButton"
                                            HeaderText="Unrealized Gain/Loss" SortExpression="UnRealisedGainLoss" UniqueName="UnRealisedGainLoss">
                                            <HeaderStyle HorizontalAlign="center" Width="65px"/>
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblUnrealisedGainLoss" Text='<%# DataBinder.Eval(Container.DataItem, "UnRealisedGainLoss") %>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="RealisedGainLoss" HeaderButtonType="TextButton"
                                            HeaderText="Realized Gain/Loss" SortExpression="RealisedGainLoss" UniqueName="RealisedGainLoss">
                                            <HeaderStyle HorizontalAlign="center" Width="65px"/>
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblRealisedGainLoss" Text='<%# DataBinder.Eval(Container.DataItem, "RealisedGainLoss") %>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="Action" HeaderButtonType="TextButton" HeaderText=""
                                            SortExpression="Action" UniqueName="Action">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="left" />
                                            <ItemTemplate>
                                                <asp:ImageButton ID="hlAddTaxLot" ToolTip="Click here to add Tax Lot" ImageUrl="~/Skins/Office2007/Grid/AddRecord.gif"
                                                    runat="server" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings AllowExpandCollapse="true">
                                    <Scrolling AllowScroll="True" ScrollHeight="50px" UseStaticHeaders="true" />
                                    <Selecting AllowRowSelect="false" />
                                </ClientSettings>
                                <FilterMenu NotSelectedImageUrl="~/Skins/GridSkin/Ice/NotSelectedMenu.gif" SelectedImageUrl="~/Skins/GridSkin/Ice/SelectedMenu.gif">
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                </FilterMenu>
                            </telerik:RadGrid>
                        </td>

Thanks,
Nagendra
Pavlina
Telerik team
 answered on 08 Dec 2010
5 answers
144 views
Hi, I've been trying to get AsyncUpload worked with RadProgress. All I got is "undefined" JavaScript error (see attached).

I've placed RadScriptManager in Master page, TemplateMain.master, and AsyncUpload, RadProgressManager, RadProgressArea in my "Default.aspx" which implements TemplateMain.master.

Any idea with this error?

Thanks
Genady Sergeev
Telerik team
 answered on 08 Dec 2010
4 answers
237 views
Hello,

I am trying to databind a RadPanelBar (2010 Q2 release) to achieve a specific behavior, and I am having trouble getting it to work.

If I have the panelbar in my aspx like so:

<telerik:RadPanelBar ID="rpbRel" runat="server" OnItemDataBound="rpbRel_ItemDataBound" >
    <ItemTemplate>
        <div class="DestinationWrapperBox">
            <asp:TextBox runat="server" id="txtRel" />
        </div>
    </ItemTemplate>
</telerik:RadPanelBar>

And code-behind like so:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim colTypes As System.Collections.ObjectModel.Collection(Of RelationshipType)
 
    rpbRel.DataSource = colTypes
    rpbRel.DataTextField = "Name"
    rpbRel.DataValueField = "ID"
    rpbRel.DataBind()
End Sub
 
Protected Sub rpbRelationships_ItemDataBound(ByVal sender As Object, ByVal  e As Telerik.Web.UI.RadPanelBarEventArgs)
    Dim oRelType As RelationshipType
    Dim txtTemp As TextBox
  
    oRelType = CType(e.Item.DataItem, RelationshipType)
  
    txtTemp = CType(e.Item.FindControl("txtRel"), TextBox)
    If Not IsNothing(txtTemp) Then
        txtTemp.Text = oRelType.Name
    End If
End Sub

Then what I get is a PanelBar that works correctly, but the items are not collapsible.  I have read in various places that I should add RadPanelItem and add a ContentTemplate and put my template there.

If I move the aspx template code, like so:
<telerik:RadPanelBar ID="rpbRel" runat="server" OnItemDataBound="rpbRel_ItemDataBound" >
    <Items>
        <telerik:RadPanelItem runat="server">
            <ContentTemplate>
                <div class="DestinationWrapperBox">
                    <asp:TextBox runat="server" id="txtRel" />
                </div>
            </ContentTemplate>
        </telerik:RadPanelItem>
    </Items>
</telerik:RadPanelBar>

And leave my codebehind the same, then I get collapsed elements that won't expand.

I have traced into the databound procedure under this second scenario, and when it binds e.item is a RadPanelBarItem that has no child items or controls, so the e.item.findcontrol("txtRel") returns nothing.

I feel like I must be binding something wrong somewhere, but I am not sure how to accomplish what I want.

Ideally, I will get PanelBarItems that have their text set to "Name", and have a textbox "under" them, that can be shown or hidden by clicking on the panelbar.  The first example gets me everything except the ability to collapse them.

Is it possible to do what I want?

Josh
Nikolay Tsenkov
Telerik team
 answered on 08 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?