Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
120 views
hi,
im using asp multiview control with two views. view1 for radgrid for item listing.
view2 for add/edit item detail. i have added,

btnDelete.Attributes.Add("onclick","javascript: return confirm('Are you sure?');")

this method doesnt make a postback event i selected ok from the confirm dialog.
when i make a change to this (found from your forum)

btnDelete.Attributes.Add("onclick","javascript: if(confirm('Are you sure?')!=true return false;")

then it give an javascript error.

when make property change in the button
CauseValidation = "false"
it works fine.

thanks,
madu.
Daniel
Telerik team
 answered on 18 Jun 2008
4 answers
463 views
Hi,

Can we have different form template for different commands ?
In my application i want different templates in case of  'Add New Record' and 'Edit'. Is it possible ?

If yes, can you give an example of how to use it.


Thanks
ankool
Top achievements
Rank 1
 answered on 18 Jun 2008
5 answers
127 views
I have a RadEditor inside an Ajax tab panel (AjaxControlToolkit -> TabContainer -> TabPanel). Property ToolbarMode is set to ShowOnFocus

<

rad:RadEditor ID="ed1" ToolbarMode="ShowOnFocus" runat="server"/>

When the editor is clicked, the toolbar shows as a vertical line and none of the tools are shown. The same code works fine (toolbar shows as expected) when the editor is not inside a TabPanel.

How do I fix this issue? Thanks.

Lini
Telerik team
 answered on 18 Jun 2008
5 answers
368 views
Hi,

I need to get the dataKey of the newly added row after automatic insert in a RadGrid.
It's possible to get it with the ItemInserted event function?
I tried to get the dataKey like as
protected void MyRadGrid_ItemInserted(object o, GridInsertedEventArgs e) 
{ 
   if (e.Exception != null) 
   { 
      e.ExceptionHandled = true; 
      //Error messsage here 
   } 
   else 
   { 
      GridEditableItem An_item = (GridEditableItem)e.Item; 
      int The_data_key = int.Parse(An_item.GetDataKeyValue("Id").ToString()); 
   } 
} 
But this code works only in the ItemUpdated case.

Yavor
Telerik team
 answered on 18 Jun 2008
1 answer
86 views
I am using .GridRowOver_Vista CSS to customize mouse over style of the grid. It works on first load, but as soon as the grid is updated via AJAX calls, the mouse over style is changed back to the default one. This happens in IE7. In Firefox 2 it works fine. I am using Telerik.Web.UI 2008.1.415.35.
Dimo
Telerik team
 answered on 18 Jun 2008
5 answers
227 views
Hi,

We are implementing a Portal page similar to the myportal sample, we are perstiting the layout to database. When moving a dock which is at the top of the Zone, the dock beneath changes position but no event is fired, thus putting him out of sync.When we reload the layout from DB an exception is thrown.
Any Ideas why the DockPositionChanged is not getting fired?
Petio Petkov
Telerik team
 answered on 18 Jun 2008
1 answer
166 views
There seems to be issues with using a formtemplate (in EditColumn) - particularly with DropDownLists - with the AllowMultiRowSelection. Selecting items in the dropdownlist select rows underneath the row being edited. Also clicking within form template draws the selection box (used for drag selecting multiple rows).

Is there a way of turning off the click and drag selection of multiple rows and only allowing shift-click or ctrl-click selection?

This is version 5.1.2.0. Below is the markup:

<rad:RadGrid ID="RadGrid1" EnableLinqExpressions="true" Skin="Vista" runat="server"
        GridLines="None" AutoGenerateColumns="False" OnEditCommand="RadGrid1_EditCommand"
        OnItemDataBound="RadGrid1_ItemDataBound" OnItemUpdated="RadGrid1_ItemUpdated"
        OnUpdateCommand="RadGrid1_UpdateCommand" OnCancelCommand="RadGrid1_CancelCommand"
        EnableAJAX="True" OnDeleteCommand="RadGrid1_DeleteCommand" AllowMultiRowSelection="true">
        <PagerStyle Mode="NextPrevAndNumeric"/>
        <MasterTableView TableLayout="Fixed" EditMode="EditForms">
            <RowIndicatorColumn Visible="False">
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="False" Resizable="False">
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <rad:GridEditCommandColumn EditText="Edit" CancelText="Cancel" HeaderStyle-Width="40px"
                    ItemStyle-ForeColor="Blue">
                </rad:GridEditCommandColumn>
                <rad:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                    ConfirmText="Delete this print job?" HeaderStyle-Width="40px" ItemStyle-ForeColor="Red" />
                <rad:GridBoundColumn DataField="TimeStamp" SortExpression="TimeStamp" HeaderText="Date"
                    HeaderStyle-Width="130px">
                </rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="DocumentName" SortExpression="DocumentName" HeaderText="Document">
                </rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="FileName" Visible="false">
                </rad:GridBoundColumn>
                <rad:GridTemplateColumn HeaderText="Status" HeaderStyle-Width="130px">
                    <ItemTemplate>
                        <%# StatusTxt((int)Eval("Status"))%>
                    </ItemTemplate>
                </rad:GridTemplateColumn>
                <rad:GridBoundColumn DataField="PaperSize" SortExpression="PaperSize" HeaderText="Paper"
                    HeaderStyle-Width="40px">
                </rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="Copies" SortExpression="Copies" HeaderText="Copies"
                    HeaderStyle-Width="40px">
                </rad:GridBoundColumn>
                <rad:GridBoundColumn DataField="PageCount" SortExpression="PageCount" HeaderText="Pages"
                    HeaderStyle-Width="40px">
                </rad:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
                <FormTemplate>
                    <div class="pqEditContent" style="">
                        <div style="float: left;">
                            <table style="border-collapse: collapse;" class="tableSimple">
                                <tr>
                                    <th>
                                        Job Properties
                                    </th>
                                </tr>
                                <tr>
                                    <td>
                                        Time:
                                    </td>
                                    <td>
                                        <%#Eval("TimeStamp") %>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        File Name:
                                    </td>
                                    <td>
                                        <asp:Literal ID="LitFN" runat="server" Text='<%#Bind("FileName") %>'></asp:Literal>
                                    </td>
                                </tr>
                               
                            </table>
                        </div>
                        <div style="float: left; width: 10px;">
                        </div>
                        <div style="float: left;">
                            <table class="tableSimple">
                                <tr>
                                    <th colspan="2">
                                        Editable Properties
                                    </th>
                                </tr>
                                <tr>
                                    <td>
                                        Status:
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="DLStatus" runat="server">
                                            <asp:ListItem Text="Queued" Value="0"></asp:ListItem>
                                            <asp:ListItem Text="Queued & Retained" Value="2"></asp:ListItem>
                                            <asp:ListItem Text="Paused" Value="1"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <tr>
                                        <td>
                                            Document Name:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TBDoc" runat="server" Text='<%#Bind("DocumentName") %>'></asp:TextBox>
                                        </td>
                                    </tr>
                                </tr>
                                <tr>
                                    <td>
                                        Paper size:
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="DLPaperSize" runat="server">
                                            <asp:ListItem Value="10- by 14-inch">10- by 14-inch</asp:ListItem>
                                            <asp:ListItem Value="A0">A0</asp:ListItem>
                                            <asp:ListItem Value="A1">A1</asp:ListItem>
                                            <asp:ListItem Value="A2">A2</asp:ListItem>
                                            <asp:ListItem Value="A3">A3</asp:ListItem>
                                            <asp:ListItem Text="A4">A4</asp:ListItem>
                                            <asp:ListItem Value="A5">A5</asp:ListItem>
                                            <asp:ListItem Value="A6">A6</asp:ListItem>
                                            <asp:ListItem Value="B2">B2</asp:ListItem>
                             
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Copies:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="TBCopies" runat="server" Text='<%#Bind("Copies") %>' MaxLength="5"
                                            Width="50px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Colour:
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="DLColour" runat="server">
                                            <asp:ListItem Value="1" Text="Colour"></asp:ListItem>
                                            <asp:ListItem Value="0" Text="B&W"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Duplex:
                                    </td>
                                   
                                </tr>
                            </table>
                        </div>
                        <div style="clear: both;">
                        </div>
                        <asp:Button ID="ButUpdate" runat="server" Text="Update" CommandName="Update" />
                        <asp:Button ID="ButCancel" runat="server" Text="Cancel" CommandName="Cancel" />
                        <asp:Button ID="ButDelete" runat="server" Text="Delete" CommandName="Delete" OnClientClick="return confirm('Delete Print Job?')" />
                    </div>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
                ClipCellContentOnResize="true" EnableRealTimeResize="false"></Resizing>
            <Selecting AllowRowSelect="True"></Selecting>
        </ClientSettings>
    </rad:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 18 Jun 2008
3 answers
136 views
Hi,
I have created a javascript in my aspx. But I always get 'Rows.length' is null or not an object error message. Please help me. Below is my javascript:

<script type="text/javascript" language="javascript">
        var grid;
        var i;
       
        function GridCreated()
        {
            grid = this;
        }
   
        function HierarchyExpanding(sender, args)
        {         
           PerformAction(grid.MasterTableView)
          
           if (i != 1000)
           {
               if(!confirm("Are you sure you want to expand without update?"))
                {
                    args.set_cancel(true);
                }
                else
                {
                    $find("<%= RadGrid1.MasterTableView.ClientID %>").collapseItem(i);
                }
           )
        }

        function PerformAction(tableview)
        {
            i = 1000;
            for (var j=0; j < tableview.Rows.length; j++)
            {
                if ($find("<%= RadGrid1.MasterTableView.ClientID %>").get_dataItems()[j].get_expanded())
                {
                    i=j;
                }
            }
        }

    </script>

And this is my radgrid:

<telerik:RadGrid ID="RadGrid1" Skin="Default" runat="server" ShowStatusBar="true"
            Width="95%" AutoGenerateColumns="False" PageSize="5" AllowSorting="True" AllowMultiRowSelection="True"
            AllowPaging="True" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
        <PagerStyle Mode="NumericPages" />
        <ClientSettings>
            <Selecting AllowRowSelect="true" />
            <ClientEvents OnGridCreated="GridCreated" OnHierarchyExpanding="HierarchyExpanding" />
        </ClientSettings>
        <MasterTableView Width="100%" HierarchyLoadMode="Client" .....

Thanks in advance.

Konstantin Petkov
Telerik team
 answered on 18 Jun 2008
1 answer
155 views
I'm having problems with the Drag and Drop feature of RadGrid.  I even notice the problems on your demo page here.

When I use Internet Explorer, I get many JavaScript errors (I have Script Debugging turned on so the errors popup).  I can get an error by:

  • Select the first item in the "Pending Orders" grid and drag it down a few rows (within the same grid)
  • Try to highlight multiple rows (by dragging the mouse over rows so it makes the "highlight" box) and I get "Object doesn't support this property or method" on a line of code that says "e.preventDefault();"

I've also got this error when I've been dragging a row and moved the mouse over a Telerik Report Viewer control (not actually dropped it on the control, but just dragged over).

I've also seen it when I click in a Text Box that is part of a Templated Column of a Grid after I've done a drag and drop on the Grid.

-Stephen

Konstantin Petkov
Telerik team
 answered on 18 Jun 2008
1 answer
101 views
Hi, I'm using the black skin on my menu and (I don't know if it does it on all skins) there is an issue where menu items marked as a "separator" look fine in Firefox and Internet Explorer 7, but there's a padding or spacing of about 10-15px in Internet Explorer 6 that I can't seem to undo -- so an item that is meant to be a separator and 1px wide, is actually 10-15px wide which causes distortion in the layout of the menu.
Alex Gyoshev
Telerik team
 answered on 18 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?