Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
114 views
I have a NestedViewTemplate within a RadGrid.  Within the NestedViewTemplate I have two other Rad-grids showing data to the parent RadGrid.  The 'select' operation on both nested RadGrid's work fine.  However, when attempting to delete a record in one of the nested RadGrid, nothing happens.  Please review the below code and advise:

 

<telerik:RadGrid ID="RadGrid2" DataSourceID="SqlDataSource3" GridLines="None" ShowGroupPanel="False" Skin="WebBlue" runat="server"

 

 

AutoGenerateEditColumn="True" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true">

 

 

<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" HideStructureColumns="true"></ExportSettings>

 

 

<MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource3"

 

 

ShowHeader="True" AllowPaging="false" CommandItemDisplay="Top">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="intInspectorID" DataType="System.Int32" HeaderText="intInspectorID"

 

 

SortExpression="intInspectorID" UniqueName="intInspectorID" Visible="false" ReadOnly="true">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="intCertificationID" DataType="System.Int32" HeaderText="intCertificationID"

 

 

SortExpression="intCertificationID" UniqueName="intCertificationID" Visible="false" ReadOnly="true">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="strCertificationDesc" HeaderText="Certification" SortExpression="strCertificationDesc"

 

 

UniqueName="strCertificationDesc">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="dtmDateExpires" HeaderText="Date Expires" SortExpression="dtmDateExpires"

 

 

UniqueName="dtmDateExpires">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridButtonColumn ConfirmText="Delete this Certification?" ButtonType="LinkButton"

 

 

CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">

 

 

<HeaderStyle Width="20px" />

 

 

<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />

 

 

</telerik:GridButtonColumn>

 

 

</Columns>

 

 

<EditFormSettings EditFormType="Template">

 

 

<FormTemplate>

 

 

<table style="width:100%; table-layout:fixed; margin: 0 0 0 0; background-color:#E6E6E6;">

 

 

<tr>

 

 

<td align="right" style=" vertical-align:top;">

 

 

<asp:Label ID="Label3" runat="server" Text="Certification:"></asp:Label>

 

 

</td>

 

 

<td align="left">

 

 

<telerik:RadComboBox ID="cboStateEdit" runat="server" DataTextField='<%# Bind("strCertificationDesc") %>'

 

 

DataValueField='<%# Bind("intCertificationID") %>' Text='<%# Bind("strCertificationDesc") %>'

 

 

SelectedValue='<%# Bind("intCertificationID") %>' Skin="WebBlue">

 

 

<Items>

 

 

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

 

 

<telerik:RadComboBoxItem Text="NICET" Value="1" />

 

 

<telerik:RadComboBoxItem Text="NICEPT" Value="2" />

 

 

<telerik:RadComboBoxItem Text="ACI" Value="3" />

 

 

<telerik:RadComboBoxItem Text="PennDOT Concrete" Value="4" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td align="right" style=" vertical-align:top;">

 

 

<asp:Label ID="Label15" runat="server" Text="Date Expires:"></asp:Label>

 

 

</td>

 

 

<td align="left">

 

 

<telerik:RadDatePicker ID="RadDatePicker1" runat="server"

 

 

DbSelectedDate='<%# Bind("dtmDateExpires") %>' EnableTyping="false">

 

 

</telerik:RadDatePicker>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2">

 

 

<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'

 

 

runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>

 

 

</asp:Button>&nbsp;

 

 

<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

 

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:inspectors %>"

 

 

SelectCommand="getInspectorCertifications" SelectCommandType="StoredProcedure"

 

 

InsertCommand="insInspectorCertifications" InsertCommandType="StoredProcedure"

 

 

UpdateCommand="updInspectorCertifications" UpdateCommandType="StoredProcedure"

 

 

DeleteCommand="delInspectorCertification" DeleteCommandType="StoredProcedure">

 

 

<SelectParameters>

 

 

<asp:ControlParameter ControlID="Label1" Name="intInspectorID" PropertyName="Text" Type="Int32" />

 

 

</SelectParameters>

 

 

<InsertParameters>

 

 

<asp:ControlParameter ControlID="Label1" Name="intInspectorID" PropertyName="Text" Type="Int32" />

 

 

<asp:Parameter Name="intCertificationID" Type="Int32" />

 

 

<asp:Parameter Name="dtmDateExpires" Type="DateTime" />

 

 

</InsertParameters>

 

 

<UpdateParameters>

 

 

<asp:Parameter Name="intCertificationID" Type="Int32" />

 

 

<asp:Parameter Name="intInspectorID" Type="Int32" />

 

 

<asp:Parameter Name="dtmDateExpires" Type="dateTime" />

 

 

</UpdateParameters>

 

 

<DeleteParameters>

 

 

<asp:Parameter Name="intCertificationID" Type="Int32" />

 

 

<asp:Parameter Name="intInspectorID" Type="Int32" />

 

 

</DeleteParameters>

 

 

</asp:SqlDataSource>

 

</

 

telerik:RadPageView>

 

Tsvetoslav
Telerik team
 answered on 08 Jul 2011
3 answers
89 views

I've tested with and without a master page, with and without our css file, no difference.


If I specify a width on the grid and the mastertableview, the grid isn't centered on the screen.
If I remove the width on the grid it is centered.
If I set UseStaticHeaders="False" the command template is the same width as the mastertableview and centered.
If I set UseStaticHeaders="True" the command tamplate width is 100% of the screen and the mastertableview is centered.

We've never been able to use HorizontalAlign="Center" becuase we've never seen it work as expected, so we've been wrapping out grids in a <table> to center them. 

Is there something I'm missing?

<telerik:RadGrid ID="RadGrid1" HorizontalAlign="Center" runat="server" AllowPaging="false"
        AllowSorting="True" GridLines="None" BorderWidth="0" PageSize="5" BackColor="White"
        GroupingEnabled="False" CellSpacing="0" Width="750"
        <MasterTableView Name="RepMaster" HorizontalAlign="Center" Width="750" CommandItemDisplay="Top"
            BorderStyle="Solid" BorderWidth="1" BorderColor="Black" TableLayout="Fixed"
            <CommandItemTemplate
                <table border="0" style="width: 100%;"
                    <tr
                        <td align="left" style="width: 125px;"
                            <asp:Button CausesValidation="false" CommandName="InitInsert" runat="server" ID="btnAddNewRecord"
                                Text=" " title="Add new record" CssClass="rgAdd" /> 
                            <asp:LinkButton CausesValidation="false" ID="lnkbAddNewRecord" CommandName="InitInsert"
                                runat="server" CssClass="Link">Add new Record</asp:LinkButton
                        </td
                        <td align="center"
                        </td
                        <td align="right" style="width: 125px;"
                            <asp:Button CausesValidation="false" CommandName="RebindGrid" runat="server" ID="btnRefresh"
                                Text=" " title="Refresh" CssClass="rgRefresh" /> 
                            <asp:LinkButton CausesValidation="false" ID="lnkbRefresh" CommandName="RebindGrid"
                                runat="server" CssClass="Link">Refresh</asp:LinkButton
                        </td
                    </tr
                </table
            </CommandItemTemplate
            <CommandItemStyle BackColor="AliceBlue" Width="500" HorizontalAlign="Center" /> 
            <Columns
                <telerik:GridTemplateColumn UniqueName="RepMasterEdit" HeaderText="Edit"
                    <HeaderStyle HorizontalAlign="Center" /> 
                    <ItemStyle HorizontalAlign="Center" /> 
                    <ItemTemplate
                        <asp:ImageButton ID="imgbEdit" runat="server" CausesValidation="False" CommandName="Select"
                            CssClass="Link" ImageUrl="~/Images/btnEdit.gif" ToolTip="Edit" /> 
                    </ItemTemplate
                </telerik:GridTemplateColumn
            </Columns
        </MasterTableView
        <ClientSettings EnableRowHoverStyle="True"
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting
            <Scrolling AllowScroll="True" ScrollHeight="100%" UseStaticHeaders="true"></Scrolling
            <ClientEvents OnRowDblClick="RowDblClick" /> 
        </ClientSettings
    </telerik:RadGrid>

Private Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
       Dim dt As New DataTable 
       'Add our columns 
       For i As Integer = 0 To 5 
           dt.Columns.Add("Field" + i.ToString, GetType(String)) 
       Next 
       Dim row As DataRow 
       For r As Integer = 0 To 50 
           row = dt.NewRow 
           For c As Integer = 0 To 5 
               row("Field" + c.ToString) = "Value " + r.ToString 
           Next 
           dt.Rows.Add(row) 
       Next 
       Me.RadGrid1.DataSource = dt 
   End Sub
Roger
Top achievements
Rank 1
 answered on 08 Jul 2011
1 answer
85 views
hello,

I have a radgrid with
 GridHyperLinkColumn gridHyperLinkColumn = new GridHyperLinkColumn();
gridHyperLinkColumn.AllowFiltering = true;
 gridHyperLinkColumn.CurrentFilterFunction = GridKnownFunction.Contains;
 gridHyperLinkColumn.ShowFilterIcon = false;
 gridHyperLinkColumn.AutoPostBackOnFilter = true;
But when i tested Filtering Function, the error occurred:
Sys$Enum$parse is not defined
parse()Teleri...98f28bc (line 8060)
b = "Contains"
a = undefined
filter()Teleri...98f28bc (line 7933)
h = "CaseId"
a = "216"
c = "Contains"
f = undefined
(?)()EditCa...seq/326 (line 2)
 
I dont know this error, please help me fix this.
thanks,
hung
Gabor
Top achievements
Rank 1
 answered on 08 Jul 2011
4 answers
137 views
I have some issue putting a datapager to a list box. Following below is my code
<telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListBox1">
 </telerik:RadDataPager>
 
  <telerik:RadListBox ID="RadListBox1" runat="server" AutoPostBack="True"
                                                DataKeyField="EventLocation" DataSourceID="Listbox"
                                                DataTextField="EventLocation" DataValueField="EventLocation"
                                                DlisataKeyField="EventLocation" Skin="Black" allowpaging="true"
                                                style="z-index: 1; left: 1109px; top: 114px; position: absolute; height: 48px; width: 155px; text-align: center;"> <ButtonSettings TransferButtons="All" />
    </telerik:RadListBox>

When i run my aspx page, it doesnt show any paging
Iana Tsolova
Telerik team
 answered on 08 Jul 2011
2 answers
35 views
So the workaround for Upload & AJAX is to do a full postback when the appropriate button is clicked.  So I have this upload, the user browses for the file they're uploading and then click submit.  But instead of just doing a full postback, the webpage never fires any server-side events and returns a bunch of nonsense (see: attached image).

I feel like this is an AJAX response?  But it does do a full-postback it seems...and it doesn't seem to fire any of my events...
Calvin
Top achievements
Rank 1
 answered on 08 Jul 2011
4 answers
193 views

I'm trying to write a workaround for the bug in your RadTabStrip control that prevents tabs from being hidden and displayed on demand.

So instead of building the tabstrip with some tabs hidden, I now add only the tab items I want displayed initially, then use javascript to add further tab items later.

Here's a snippet of the js code...

var tabStrip = $find('myTabStrip');
 
var tab = new Telerik.Web.UI.RadTab();
tab.set_text('text');
tab.set_value('pseudo-id_because_ID_field_is_weirdly_not_supported');
 
var attributes = tab.get_attributes();
attributes.setAttribute("onclick", "alert('hello')");
 
tabStrip.get_tabs().insert(1, tab);

this runs ok and adds a tab to the page, but the attribute is never set, and when I look at the page source it has never been rendered. The items rendered using server side code with the same settings work fine.

Is there something else I should be doing, or is this another bug?

John
Top achievements
Rank 1
 answered on 08 Jul 2011
1 answer
118 views
Hi,
I am not able to find the all day Checkbox Value in  AppointmentInsert Event And also The CustomAttribute textbox also not able to find. Please Help me on this.
Plamen
Telerik team
 answered on 08 Jul 2011
1 answer
83 views
Hi,

I wonder how I can resolve the following issue.

I have tab strip set with attributes:
PerTabScrolling="false"
ScrollChildren="true"
ScrollButtonsPosition="Right"
OnClientLoad="rtsAutoSelectFirstTab"
OnClientTabSelecting="rtsTabSelecting"

        function rtsAutoSelectFirstTab()
        {
            var rts = $find("<%=rts.ClientID%>");
            rts.get_tabs().getTab(0).scrollIntoView();
        }

        function rtsTabSelecting(sender, args)
       {
            //scroll intto visible area selected tab
            args.get_tab().scrollIntoView();
       }


each Tab in a strip has "close tab" image, which removes tab on click. Tab removal is organized on server side and tab strip is getting rebuilt, with 1st tab auto selected.

While all tabs are visible w/o scrolling, no issues are there, however, after I add enough tabs, scroll to the right and start removing them one by one, at some point scroll bar disappears and the leftmost tab disapears from the view or being shown only as a part. Despite having rtsTabSelecting, this leftmost tab is not shown as it should.

any help would be appreciated!

Thanks!
Kate
Telerik team
 answered on 08 Jul 2011
5 answers
99 views
Hi All,

I'm binding my grid with the client-side api.  My data gets populated but by default displays with my ID field in ASC order.  I'd like change this and have it appear in DESC order.  I cannot change the query from the datasource.  I've tried playing around with the mastertableview's fireCommand "sort" but it creates an undesired postback.  There must be a way to do sort on a field right after the initial load.

Thx in advance. 
Tsvetina
Telerik team
 answered on 08 Jul 2011
1 answer
104 views
I have RadGrid inside of the user control which has ViewState turned off. Everything runs fine, including default paging. The problem is that I cannot make custom paging to work because if grid has AllowCustomPaging=true then CurrentPageIndex is always 0 since the container has view state disabled. The grid itself has EnableViewState="true" but it appears that it stores CurrentPageIndex elsewhere.

There is OnPageIndexChanged event which does fire and gives me the next page index, but I cannot use it to store index in the session because this event fires AFTER OnNeedDataSource. I wish there was OnPageIndexChanging event..

How can I make it to work?

-Stan
Tsvetina
Telerik team
 answered on 08 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
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
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?