Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
148 views
I have rad grid on my webpage , I have hierarichal radgrid, My problem is even i have set to have only one column in detailtables, it still show all columns from my select statement of sqldatasource. Here is my grid:-
<telerik:RadGrid ID="gvEmailList" runat="server" AllowSorting="True" CellSpacing="0"
          DataSourceID="SqlDataSource1" GridLines="None" ShowGroupPanel="False" Skin="Outlook">
          <ClientSettings AllowDragToGroup="True" AllowExpandCollapse="true">
              <Selecting AllowRowSelect="True" />
          </ClientSettings>
          <MasterTableView AutoGenerateColumns="False" DataKeyNames="Alert_ID" DataSourceID="SqlDataSource1">
              <GroupByExpressions>
                  <telerik:GridGroupByExpression>
                      <SelectFields>
                          <telerik:GridGroupByField FieldAlias="Email_Subject" FieldName="Email_Subject" />
                      </SelectFields>
                      <GroupByFields>
                          <telerik:GridGroupByField FieldName="Email_Subject" HeaderText="Subject" />
                      </GroupByFields>
                  </telerik:GridGroupByExpression>
              </GroupByExpressions>
              <DetailTables>
                  <telerik:GridTableView DataKeyNames="Alert_ID" DataSourceID="SqlDataSource6" Width="100%"
                      runat="server" HierarchyLoadMode="Client" ShowHeader="false">
                      <ParentTableRelation>
                          <telerik:GridRelationFields DetailKeyField="Alert_ID" MasterKeyField="Alert_ID" />
                      </ParentTableRelation>
                      <Columns>
                          <telerik:GridTemplateColumn>
                              <ItemTemplate>
                                  <asp:TextBox ID="txtBody" runat="server" TextMode="MultiLine" Height="250px" Text='<%# BIND("Email_Body") %>'
                                      Width="100%"></asp:TextBox>
                              </ItemTemplate>
                          </telerik:GridTemplateColumn>
                      </Columns>
                  </telerik:GridTableView>
              </DetailTables>
              <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
              <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                  <HeaderStyle Width="20px"></HeaderStyle>
              </RowIndicatorColumn>
              <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                  <HeaderStyle Width="20px"></HeaderStyle>
              </ExpandCollapseColumn>
              <Columns>
                  <telerik:GridTemplateColumn HeaderText="">
                      <HeaderTemplate>
                          <asp:CheckBox ID="chkAll" runat="server" Text="Select All" OnCheckedChanged="chkAll_CheckedChanged"
                              AutoPostBack="true" />
                          <asp:Button ID="BtnArchive" runat="server" Text="Archive" OnClick="BtnArchiveAll_Click" />
                      </HeaderTemplate>
                      <ItemTemplate>
                          <asp:CheckBox ID="chkAlertID" runat="server" />
                          <asp:HiddenField ID="hdAlertID" runat="server" Value='<%#EVAL("ALERT_ID") %>' />
                          <asp:HiddenField ID="hdColorCode" runat="server" Value='<%#EVAL("Alert_Level_Color_Code") %>' />
                      </ItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridBoundColumn DataField="Alert_State" FilterControlAltText="Filter Alert_State column"
                      HeaderText="Alert_State" SortExpression="Alert_State" UniqueName="Alert_State"
                      ItemStyle-Width="50px">
                      <ItemStyle Width="50px"></ItemStyle>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Email_Subject" FilterControlAltText="Filter Email_Subject column"
                      HeaderText="Email_Subject" SortExpression="Email_Subject" UniqueName="Email_Subject"
                      ItemStyle-Width="200px">
                      <ItemStyle Width="200px"></ItemStyle>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Email_Sender" FilterControlAltText="Filter Email_Sender column"
                      HeaderText="Email_Sender" SortExpression="Email_Sender" UniqueName="Email_Sender"
                      ItemStyle-Width="100px">
                      <ItemStyle Width="100px"></ItemStyle>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Email_DateReceived" DataType="System.DateTime"
                      FilterControlAltText="Filter Email_DateReceived column" HeaderText="Email_DateReceived"
                      SortExpression="Email_DateReceived" UniqueName="Email_DateReceived" ItemStyle-Width="80px">
                      <ItemStyle Width="80px"></ItemStyle>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Alert_Level_Descr" FilterControlAltText="Filter Alert_Level_Descr column"
                      HeaderText="Alert_Level_Descr" SortExpression="Alert_Level_Descr" UniqueName="Alert_Level_Descr"
                      ItemStyle-Width="100px">
                      <ItemStyle Width="100px"></ItemStyle>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Alert_Source" FilterControlAltText="Filter Alert_Source column"
                      HeaderText="Alert_Source" SortExpression="Alert_Source" UniqueName="Alert_Source"
                      ItemStyle-Width="100px">
                      <ItemStyle Width="100px"></ItemStyle>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Alert_Server" FilterControlAltText="Filter Alert_Server column"
                      HeaderText="Alert_Server" SortExpression="Alert_Server" UniqueName="Alert_Server">
                  </telerik:GridBoundColumn>
                  
              </Columns>
              <EditFormSettings>
                  <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                  </EditColumn>
              </EditFormSettings>
          </MasterTableView>
          <FilterMenu EnableImageSprites="False">
          </FilterMenu>
          <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
          </HeaderContextMenu>
      </telerik:RadGrid>
As you can see i just have one template column in Details Table but It shows me four more columns in addition to this column from my select statement.
Sonia
Top achievements
Rank 1
 answered on 19 Aug 2011
1 answer
121 views
Hi Guys,

I'm experiencing a strange glitch in the process of creating a dynamic RadMenu. What I'm trying to accomplish is to create a menu using 2 sql statements. The first one will create the root layer, and the second one will create the children. Here is the code that I use for the root layer which is working correctly:

 

 

Dim item1 As New RadMenuItem()

 

item1.Text = DataReader(

 

"menu_name").ToString.Trim()

 

item1.Font.Bold =

 

True

 

item1.Width = 185


Here is the code for the children, which I'm looping through the second datareader:

 

 

Dim item11 As New RadMenuItem()

 

item11.Text = DataReaderB(

 

"page_name").ToString.Trim()

 

item11.NavigateUrl =

 

"InteriorPages.aspx?ID=" & DataReaderB("id")

 

item1.Items.Add(item11)

RadMenu1.Items.Add(item1)


For the most part, this is working correctly... Except one of the six menu items that I'm testing doesn't show its children. Now it has the arrow on the right hand side of the root level and while stepping through the code it should be adding several children and there are no errors. Its the same item each time.

What can I be doing so wrong that would cause this to happen?

Any help would be greatly appreciated.

William
William
Top achievements
Rank 1
 answered on 19 Aug 2011
4 answers
154 views
I have been trying to figure out a solution I can use across my entire site. Each tooltip has different content and they all have a targetControlId set on them. My problem is, on load, I want to find all tooltips on the page without referencing specific name. Once I have the collection I need to be able to access the targetControlId so I can bind hover AND click events through JavaScript. I have the code for assigning hover and click, I just need the collection and access to the targetControlId attribute.
Patrick
Top achievements
Rank 1
 answered on 19 Aug 2011
3 answers
177 views
Hi,

Has anyone used Umbraco and Telerik controls - when I add the RadRotator and set the Umbraco macro to cache the control then it stops working. The first page load is ok, subsequent page loads show nothing.

I'm really scratching my head here!

Thanks.
Dan
Top achievements
Rank 1
 answered on 19 Aug 2011
2 answers
112 views
I am trying to update values of first combobox based on another combobox's sected value in the rad grid's formtemplate.It si not updating properly.Could you please help me to fix this problem.
Here is my code.

ASPX

 

 

<tr>

 

 

 

<td align="left">

 

 

 

<telerik:RadComboBox EnableScreenBoundaryDetection="false" ID="rdcbCustomer" runat="server" Skin="Vista" AppendDataBoundItems="true"

 

 

 

Filter="StartsWith" DataSource='<%# Iif (TypeOf Container is GridEditFormInsertItem, ActiveCustomers, Customers) %>'

 

 

 

DataTextField="Name" DataValueField="CustomerId" AutoPostBack="true" CausesValidation="false" OnSelectedIndexChanged="rdcbCustomer_OnSelectedIndexChanged">

 

 

 

<Items>

 

 

 

<telerik:RadComboBoxItem Text="---Select---" Value="-1" Selected="true" />

 

 

 

</Items>

 

 

 

</telerik:RadComboBox>

 

 

 

<br />

 

 

 

<asp:RequiredFieldValidator ID="customerValid" ControlToValidate="rdcbCustomer" Text="Customer is required."

 

 

 

Display="dynamic" runat="server" InitialValue="---Select---" /><br />

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr align="left">

 

 

 

<td>

 

 

 

<b>Party: *</b>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td align="left">

 

 

 

<telerik:RadComboBox EnableScreenBoundaryDetection="false" ID="rdcbParty" runat="server" Skin="Vista" AppendDataBoundItems="true"

 

 

 

Filter="StartsWith" DataSource='<%# Parties %>' DataTextField="Name" DataValueField="PartyId">

 

 

 

<Items>

 

 

 

<telerik:RadComboBoxItem Text="---Select---" Value="-1" Selected="true" />

 

 

 

</Items>

 

 

 

</telerik:RadComboBox>

 

 

 

<br />

 

 

 

<asp:RequiredFieldValidator ID="partyValid" ControlToValidate="rdcbParty" Text="Party is required."

 

 

 

Display="dynamic" runat="server" InitialValue="---Select---" /><br />

 

 

 

</td>

 

 

 

</tr>

 



ASPX.VB

 

 

Protected Sub rdcbCustomer_OnSelectedIndexChanged(ByVal o As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs)

 

Parties = LoadPartiesListByCustomer(e.Value)

 

 

Dim combo1 As RadComboBox = TryCast(o, RadComboBox)

 

 

 

Dim editItem As GridEditFormItem = TryCast(combo1.NamingContainer, GridEditFormItem)

 

 

 

Dim combo2 As RadComboBox = TryCast(editItem.FindControl("rdcbParty"), RadComboBox)

 

combo2.DataSource = Parties

 

 

End Sub

 

 

 

Protected Function LoadPartiesListByCustomer(ByVal cust_id) As IList(Of Party)

 

 

 

Dim party As IList(Of Party) = New List(Of Party)()

 

 

 

Dim dtParty As DataTable = cDA.GetPartiesByCustomer(cust_id)

 

 

 

If dtParty.Rows.Count > 0 Then

 

 

 

For Each dr As DataRow In dtParty.Rows

 

 

 

Dim p As New Party()

 

p.PartyId =

 

Convert.ToInt32(dr("PartyId"))

 

p.Name =

 

Convert.ToString(dr("Name"))

 

p.IsActive =

 

Convert.ToBoolean(dr("IsActive"))

 

party.Add(p)

 

 

Next

 

 

 

End If

 

 

 

'Parties.Clear()

 

 

Parties = party

 

 

Return Parties

 

 

 

End Function

 

Please help me to fix this problem
hari
Top achievements
Rank 1
 answered on 19 Aug 2011
1 answer
153 views
Hi,

I have several Notifications which are activated OnPostback setting VisibleOnPageLoad = True from codebehind.

How do i stack these? They are all shown all in same position now.

Thanks,
Marc
Marin Bratanov
Telerik team
 answered on 19 Aug 2011
5 answers
362 views
Hi
Environment: RadControls for ASP.NET AJAX Q3 2009 / VS 2008 SP1/IE7/WINXP SP 2.

I am using this Telerik Link as a prototype for my Project:

 

http://demos.telerik.com/aspnet-ajax/spell/examples/programming/datagrid/defaultcs.aspx

Question is that: How do I use the image  ButtonType = "ImageButton"  for Spell Check in Rad Grid...

Attached are my screen shoots. I would like to see spell checker button type as (spellcheck.PNG),  but not like untitled-3 copy.jpg .  I can use the Image Button for regular text Box but did not find any thread for Grid Template Columns..

Thanks

Below is my Grid Declaration:

<telerik:RadGrid ID="RadGrid1">
''''
''''

 

 

 

 

<
asp:TemplateColumn HeaderText="Description">  
<ItemTemplate> 
<asp:Label ID="lblField1" CssClass="text" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductDescription") %>' /> 
</ItemTemplate> 
<EditItemTemplate> 
<asp:TextBox runat="server" ID="ProductDescription" TextMode="MultiLine" Rows="4" 
Columns="40" Text='<%# DataBinder.Eval(Container.DataItem, "ProductDescription") %>' /> 
<telerik:RadSpell ID="RadSpell1" runat="server" ControlToCheck="ProductDescription" /> 
</EditItemTemplate> 
</asp:TemplateColumn> 

''''
''''
</telerik:RadGrid>

 

 

 

 

 

 

Marin Bratanov
Telerik team
 answered on 19 Aug 2011
5 answers
454 views
I have a RadTabStrip that has to perform some server-side processing where a file streamed into a database and uploaded. I have this working successfully. 

When this processing completes I need to set focus on a different tab in the PageMultiPage and that new tab needs to requery the database and refresh its dislayed contents ... in essence a postback to query the database and display current values in a RadGrid. 

Is there a way to trigger this navigation and postback on the the new tab?  Is there a way to cause a postback when the user changes tabs?

If so, please list code example on how to do this.

Thanks.
 





Steve
Top achievements
Rank 1
 answered on 19 Aug 2011
2 answers
166 views
Hi

I am trying to call a RadWindow Alert from a RadGrid ItemCommand but get this exception

"Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object."

I am trying to test for some selected items within a sub-grid, so my code is:

public static void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            RadGrid RadGrid1 = (RadGrid)sender;
            if (e.CommandName == "AddToCart")
            {
                if (RadGrid1.SelectedIndexes.Count == 0)
                {
                    RadWindowManager1.RadAlert("No documents have been selected", 250, 100, "Add to Document Cart", "");
                    return;
                }
                GridCommandItem Item = (GridCommandItem)e.Item;
                ImageButton btnAddToCart = (ImageButton)e.Item.FindControl("btnAddSelectedToCart");
                ....
                ..... rest of code...
            }
}

This errors on the RadAlert line...
Any clues please.
Simon
Top achievements
Rank 1
 answered on 19 Aug 2011
1 answer
143 views
I need change somes style of RadFilter.
i added RadFilter.css in my project and the follow control_:
                   <telerik:RadFilter
                            ID="RadFilter3" runat="server"  
                            Culture="es-AR"  CssClass="RadFilter RadFilter_Default"
                            ExpressionPreviewPosition="Bottom" Skin="Vista">
                        <FieldEditors>
                            <telerik:RadFilterTextFieldEditor DisplayName="Fulltext" FieldName="1" />
                            <telerik:RadFilterTextFieldEditor DisplayName="Name" FieldName="2" />
                            <telerik:RadFilterTextFieldEditor DisplayName="Modified" FieldName="3" />
                        </FieldEditors>
                        </telerik:RadFilter>
    
Ths css is:
.RadFilter_Default,.RadFilter_Default .rfDiv{display:block}
.RadFilter_Default:after,.RadFilter_Default .rfDiv:after{content:"";display:block;height:0;visibility:hidden;}

.RadFilter_Default.rfField {
  display: block !important;
}

If I have in aspx:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
ths css doesnt work

But if i change it by this:
<!DOCTYPE html >

If works!

BUT I need use
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

How I can resolved this issue??

I attach imnage with DOCTYPE  and whitout DOCTYPE

I need RadFilter such as withoutDocType Image

Galin
Telerik team
 answered on 19 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?