Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
241 views
Hi,

We are trying to do something like Telerik online purchase check out list where user could update the quality by using combobox and also delete product as they wish.

We only manage to bind the session to the Grid, but, we are not able to bind the delete command and also the edit to the Grid item. The RadGrid1_ItemDeleted will never been fired.

Please advice.

Dim objDT As System.Data.DataTable 
Dim objDR As System.Data.DataRow 
 
Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
objDT = Session("Cart"
RadGrid1.DataSource = objDT 
End Sub 
 
Protected Sub RadGrid1_ItemDeleted(ByVal source As ObjectByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGrid1.ItemDeleted 
' Some code to delete 
End Sub 
 
Private Sub makeCart() 
If IsNothing(Session("Cart"))Then 
objDT = New System.Data.DataTable("Cart"
objDT.Columns.Add("ID"GetType(Integer)) 
objDT.Columns("ID").AutoIncrement = True 
objDT.Columns("ID").AutoIncrementSeed = 1 
objDT.Columns("ID").Unique = True 
objDT.Columns.Add("Quantity"GetType(Integer)) 
objDT.Columns.Add("ProductName"GetType(String)) 
objDT.Columns.Add("ProductID"GetType(Integer)) 
objDT.Columns.Add("Cost"GetType(Decimal)) 
Session("Cart") = objDT 
End Sub 

            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None" ShowFooter="True" AllowPaging="True" AllowAutomaticDeletes="True" PageSize="20" AllowAutomaticUpdates="True" OnNeedDataSource="RadGrid1_NeedDataSource"
                <PagerStyle Mode="NextPrevAndNumeric" /> 
                <MasterTableView DataKeyNames="ID" HorizontalAlign="NotSet" AutoGenerateColumns="False"
                <Columns> 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                        <ItemStyle CssClass="MyImageButton" /> 
                    </telerik:GridEditCommandColumn>                 
                    <telerik:GridBoundColumn Aggregate="Count" DataField="ID" HeaderText="Product ID" 
                        FooterText="Total products: " UniqueName="ID"
                    </telerik:GridBoundColumn>     
                    <telerik:GridBoundColumn DataField="ProductName" HeaderText="Product name" SortExpression="ProductName" 
                        UniqueName="ProductName"
                    </telerik:GridBoundColumn>      
                    <telerik:GridBoundColumn Aggregate="Sum" DataField="Cost" HeaderText="Unit price" 
                        FooterText="Total unit price: " UniqueName="Cost"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn Aggregate="Sum" DataField="Quantity" HeaderText="Qty" 
                        FooterText="All units in stock: " UniqueName="Quantity"
                    </telerik:GridBoundColumn>  
                    <telerik:GridCalculatedColumn HeaderText="Total Price" UniqueName="TotalPrice" DataType="System.Double" 
                        DataFields="Quantity, Cost" Expression="{0}*{1}" FooterText="Total Price: " 
                        Aggregate="Sum" />                                                              
                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                        UniqueName="DeleteColumn"
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                    </telerik:GridButtonColumn>                      
                </Columns> 
                </MasterTableView> 
                 
            </telerik:RadGrid> 



Sebastian
Telerik team
 answered on 24 Mar 2009
1 answer
111 views
Hello!

I think I've found small bug. When I convert my web application to Telerik Web Application in web.config there is added:
<authentication mode="Windows" /> 
even if I have already
    <authentication mode="Forms"
      <forms name="login" loginUrl="~/admin/login.aspx" /> 
    </authentication> 
Regards
Andrey
Telerik team
 answered on 24 Mar 2009
3 answers
502 views
I am in the process of upgrading my application from ASP.NET Classic controls to the ASP.NET AJAX controls.

I have multiple places where I use a RadGrid inside an MS UpdatePanel - Using a Linkbutton (or a GridButtonColumn) on each row. The LinkButton fires the ItemCommand event back on the server, which in turn prepares some information in another UpdatePanel on the page and calls a ModalPopupExtender to show the second UpdatePanel as a modal box. Here is some psuedo code on how its set up...

... Aspx Page Structure ...

<UpdatePanel id=UpdatePanel1>
    <RadGrid id=RadGrid1 OnItemCommand="RadGrid1_ItemCommand" >
        Grid Markup
    </RadGrid>
</UpdatePanel>

<UpdatePanel id=UpdatePanel2>
    <ModalPopupExtender id=ModalPopupExtender1>        
    Page Markup
</UpdatePanel>

...code behind...

RadGrid1_ItemCommand(sender, args)
{    
    ...format controls in UpdatePanel2 ...
    
    UpdatePanel2.Update()
    ModalPopupExtender1.Show()
}

This has been working great with the Classic RadGrid - but now with the AJAX RadGrid the ModalPopupExtender1.Show() will not display the modal box. The ItemCommand is firing just fine and the code executes as before. It just wont "Show" the popup extender. I have other modal popup extenders on the page that are displayed using the codebehind .Show() method of the extender, but are just not called from within the grid and they are working fine also.

What is different about the AJAX version of RadGrid that would make this happen? Any clues on how to resolve the issue?

Thanks... Russ
    
    
Sebastian
Telerik team
 answered on 24 Mar 2009
2 answers
143 views
Hi,

Is it possible to hide only top border of plot area? Its common in business charts.

Best regards
possible
Top achievements
Rank 1
 answered on 24 Mar 2009
1 answer
124 views
Hi telerik team,

i have a doubt relative to resize of image inside editformsettings.
 in one of my radgrid  save and cancel  images available, if i use those images inside editformsettings half of the text is getting crop (For ex: save in which v , cancel c is not getting visible ) i m unable to give width or height of image .but same images if i give in templatecolumn looking fine. the code which i followed is below
<EditFormSettings>                                                                    
                                        <EditColumn ButtonType="ImageButton" UpdateImageUrl="~/App_Themes/images/save2.gif" 
                                            EditImageUrl="~/App_Themes/images/Edit.gif" InsertImageUrl="~/App_Themes/images/save2.gif" 
                                            CancelImageUrl="../App_Themes/images/cancel1.gif" Resizable="true" InsertText="Insert Document" 
                                            UpdateText="Update Document" UniqueName="EditCommandColumn1" CancelText="Cancel "
                                        </EditColumn> 
                                        <FormTableButtonRowStyle Width="100%" HorizontalAlign="Right"></FormTableButtonRowStyle>                                         
                                    </EditFormSettings>
Yavor
Telerik team
 answered on 24 Mar 2009
1 answer
203 views
I am trying to retrieve data from a stored procedure. Our SP's are written to be generic so while they can have up to 24 parameters they only need one parameter (or many) to run. I have built a grid that puts a default value into one of 8 parameters for this SP. If I run a Test Query I get the data I expect back. When I try running the web page I get nothing (actually a thin gray bar across the top of the web page). I know the connection and page are setup correctly because if I run another SP that has no parameters I get data back. Any ideas on why this is occurring (or not)? Does this have something to do with binding?

TIA,

Joe B
Shinu
Top achievements
Rank 2
 answered on 24 Mar 2009
1 answer
84 views
Hi
   I am using Rad grid in my application. I have to display some message on RequestStart and RequestEnd events when a link is clicked. It works correctly for certain links and not works for a particular link.
For some links it calls RadGridNamespace.AsyncRequest() javascript function and it works coorectly. For a particular link it calls the javascript function RadGridNamespace.AsyncRequestWithRequest()  and it doesnt fire the RequestEnd event.

Please help me out in this issue.

Thanks in advance.

Gayatri
Yavor
Telerik team
 answered on 24 Mar 2009
1 answer
160 views
Hi,
I am using older version of telerik controls. RadGrid is not rendering its skin (any which i set) and also its giving javascript error "RadGridNameSpace is undefined". I am only getting this error on my one site. while it is working perfect on my other sites.
I have already put radcontrols folder on root of site. also rad dlls in bin folder. Its very strange to me why it is happening with me.please help me to resolve this issue.

  <radg:RadGrid  ID="gridReport" runat="server" AllowPaging="True" AllowSorting="True"
                                            AutoGenerateColumns="True" EnableAJAX="True" EnableAJAXLoadingTemplate="True"
                                            EnableOutsideScripts="True" 
                                            PagerStyle-Mode="NumericPages" PagerStyle-Position="TopAndBottom" PageSize="20"
                                            Skin="GrayGrid" Width="100%" OnNeedDataSource="gridReport_NeedDataSource" OnItemDataBound="gridReport_ItemDataBound" OnSortCommand="gridReport_SortCommand" OnColumnCreated="gridReport_ColumnCreated">
                                            <ClientSettings>
                                                <ClientEvents OnRequestStart="RequestStart" />
                                                <Selecting AllowRowSelect="True" />
                                            </ClientSettings>
                                            <MasterTableView CommandItemDisplay="Top">
                                                <CommandItemTemplate>
                                                    <table class="TGridComTemplate">
                                                        <tr>
                                                            <td id="tdButtonExport">
                                                                <asp:LinkButton ID="lbtExcel" runat="server" CssClass="LabelStyle" OnClick="lbtExcel_Click"
                                                                    OnClientClick="return ExportReport()"><img style="border:0px" alt="" src="../../Images/excel.gif" /> Export to Excel</asp:LinkButton></td>
                                                            <td id="tdPrint">
                                                            &nbsp;<asp:LinkButton ID="lbtPrint" runat="server" CssClass="LabelStyle"
                                                                    OnClientClick="return PrintReport()" OnClick="lbtPrint_Click"><img style="border:0px" alt="" src="../../Images/print.gif" /> Print</asp:LinkButton>
                                                           </td>
                                                        </tr>
                                                    </table>
                                                </CommandItemTemplate>
                                                <Columns>                                                                                              
                                                </Columns>
                                                <ExpandCollapseColumn Visible="False">
                                                    <HeaderStyle Width="19px" />
                                                </ExpandCollapseColumn>
                                                <RowIndicatorColumn Visible="False">
                                                    <HeaderStyle Width="20px" />
                                                </RowIndicatorColumn>
                                            </MasterTableView>
                                            <CommandItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemStyle HorizontalAlign="Center" />
                                            <AlternatingItemStyle HorizontalAlign="Center" />
                                            <PagerStyle Mode="NumericPages" Position="TopAndBottom" />
                                        </radg:RadGrid>
Georgi Krustev
Telerik team
 answered on 24 Mar 2009
9 answers
642 views
How do I get the data vaues in the insert command?

And after I save the data, how do I close the input window?

Here's what I've tried:

    Protected Sub RadGrid_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
        'Get the GridEditFormInsertItem of the RadGrid       
        Dim insertedItem As GridEditFormInsertItem = TryCast(e.Item, GridEditFormInsertItem)
        ' Get an error on the next line
        Dim ProductName As String = (TryCast(insertedItem("ProductName").Controls(0), TextBox)).Text
        Dim UnitPrice As String = (TryCast(insertedItem("UnitPrice").Controls(0), TextBox)).Text
        Dim UnitsOnOrder As String = (TryCast(insertedItem("UnitsOnOrder").Controls(0), TextBox)).Text
        Dim insertQuery As String
        insertQuery = "insert into Products set "
        insertQuery = insertQuery & " ProductName='" & ProductName & "'"
        insertQuery = insertQuery & " ,UnitPrice=" & UnitPrice
        insertQuery = insertQuery & " ,UnitsOnOrder=" & UnitsOnOrder
        ' Execute the query
        GridDataBind()  ' Now that the data has been changed

    End Sub

Bruce
Top achievements
Rank 1
 answered on 24 Mar 2009
2 answers
77 views

Dear,

Actually I was confused where to post this problem...

I am making a search page whose details are as follows

textbox , button

button click

{

         dataset ds = getdata("select id,desc_hort,desc_long from my_db where id='" + textbox.text + "';");

         radgrid.datasource = ds;

         radgrid.databind();

}

radgrid

..........     <telerik:GridTemplateColumn UniqueName="tempcol">
<ItemTemplate>
<tr>
<td>
<a href="details.aspx?id='<%#Eval("id") %>' " target=_blank> <%#Eval("desc_short")%></a><br>
<%#Eval("desc_long")%> 
</td>
</tr>
</ItemTemplate>
</telerik:GridTemplateColumn>

all is going well but i felt to implement a new concept of radwindow

now problem with me is that insted of opening details in new page with target=_blank i want to open link in

radwindow

i reffered example

http://demos.telerik.com/aspnet-ajax/window/examples/demoemail/defaultcs.aspx

but as i am a newbie i am unable to understand where to make changes to open that link in radwindow

thanks in advance

sadiqabbas
Top achievements
Rank 1
 answered on 24 Mar 2009
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?