Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
236 views
I would like to get the value of a textbox in a GridTemplateColumn. I have tried and tried to find an answer to this question. Please DO NOT refer me to any of the following:

http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/accessingcellsandrows/defaultcs.aspx

http://www.telerik.com/community/forums/aspnet-ajax/grid/retrieving-value-from-radgrid-in-editmode-on-a-external-button-click.aspx

http://www.telerik.com/community/forums/aspnet-ajax/grid/button-click-event-and-radgrid.aspx

I have been to dozens and dozens of these links and NONE of them provide a simple, straight forward example to solve this. I have left several posts requesting similar examples with no resolution. Here is the code I am attempting to use:

ASPX:

<telerik:RadGrid ID="rgd_ABIUser" runat="server"  GridLines="None" AutoGenerateColumns="False" Width="400px" style="height: 46px">
    <MasterTableView DataKeyNames="ID">
        <RowIndicatorColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
            <Columns>
                <telerik:GridTemplateColumn DataField="SC" HeaderText="Site" SortExpression="SC" UniqueName="SC">
                    <ItemTemplate>
                        <asp:TextBox ID="tbx_Site"  Text='<%# Bind("SC") %>' runat="server" Width="30px"></asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="ID" HeaderText="User" SortExpression="ID" UniqueName="ID">
                    <ItemTemplate>
                        <asp:TextBox ID="tbx_UserID"  Text='<%# Bind("ID") %>' runat="server"></asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="PW" HeaderText="Password" SortExpression="PW" UniqueName="PW">
                    <ItemTemplate>
                        <asp:TextBox ID="tbx_Password"  Text='<%# Bind("PW") %>' runat="server"></asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="SN" HeaderText="TCH#" SortExpression="SN" UniqueName="SN" >
                    <ItemTemplate>
                        <asp:TextBox ID="tbx_TchNo"  Text='<%# Bind("SN") %>' runat="server" Width="30px"></asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="TG" HeaderText="Group" SortExpression="TG" UniqueName="TG">
                    <ItemTemplate>
                        <asp:TextBox ID="tbx_TG"  Text='<%# Bind("TG") %>' runat="server" Width="20px"></asp:TextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
    </MasterTableView>
</telerik:RadGrid>

Here is my ASPX.VB

Protected Sub btn_UpdateUser_Click(sender As Object, e As System.EventArgs) Handles btn_UpdateUser.Click
    For Each item As GridDataItem In rgd_ABIUser.Items
        'Here is one way I have seen to get the value
        Dim txtBox As TextBox = DirectCast(item("PW").FindControl("tbx_Password"), TextBox)
        Dim PW As String = txtBox.Text
        'Here is a different way I have seen to get the value
        Dim SN As String = DirectCast(TryCast(item.FindControl("tbx_TchNo"), TextBox).Text, String)
        Dim TG As String = DirectCast(TryCast(item.FindControl("tbx_TG"), TextBox).Text, String)
        Dim DatabaseName As String = Session("DataBase")
        Dim Val = Session("Site")
        Dim Site As Integer = Convert.ToInt32(Val)
        Dim IDUser As String = Session("ID")
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=XXXX;UID=XXXX;PWD=XXX;")
        Dim command = New SqlCommand("aa_abi_users_update", connectionString)
        command.CommandType = CommandType.StoredProcedure
        command.Parameters.Add("@DBName", SqlDbType.VarChar).Value = DatabaseName
        command.Parameters.Add("@IDSite", SqlDbType.Int).Value = Site
        command.Parameters.Add("@IDUser", SqlDbType.VarChar).Value = IDUser
        command.Parameters.Add("@PW", SqlDbType.VarChar).Value = PW
        command.Parameters.Add("@SN", SqlDbType.VarChar).Value = SN
        command.Parameters.Add("@TG", SqlDbType.VarChar).Value = TG
        command.Connection.Open()
        command.ExecuteNonQuery()
        command.Connection.Close()
    Next

Any help much appreciated.

Allan
Top achievements
Rank 2
 answered on 18 Mar 2011
2 answers
73 views
I am looking for an efficient way to take the filtered value from one RadGrid and pass that value to another RadGrid (to update the data).

A quick search yielded no results, is this something any of you have tried before? If so, can you point me in the right direction?

Thanks!
Royal
Top achievements
Rank 1
 answered on 18 Mar 2011
1 answer
82 views
Hello,

I have a menu that when a user clicks an item it postback using the RadAjaxPanel.

Well in certain items i need to cancel the ajax request for like the 'DOWNLOAD FILE' item but leave it on for other items.

Im using the Panels onRequestStart but all it returns in the eventtarget is my menu ID is there anyway to find the ITEM within the menu that triggered the AJAX?

Or should i make a custom menu items with buttons?

CODE:
<script type="text/javascript">
            function onRequestStart(sender, args) {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToPdfButton") >= 0) {
                    args.set_enableAjax(false);
                }
                if (args.get_eventTarget().indexOf("FilesMenu") >= 0)
                {
                    alert("ET: " + args.get_eventTarget());
                    alert("EA: " + args.get_eventArgument());
                    alert("ETE ID: " +args.get_eventTargetElement().id);
                    args.set_enableAjax(false);
                }
            }
        </script>
Helen
Telerik team
 answered on 18 Mar 2011
1 answer
59 views
I don't know whether or not it is by design, but I have VS2008 and VS2010 on my machine and the MSDN help, part of VS 2008 was updated with the new docs for JustCode but not for those for RadControls for ASP.NET AJAX.

When I click on the link to open the docs in a browser and navigate to the API Reference | Telerik.Web.UI Namespace the top of the page indicates a missing reference...

[Missing <summary> documentation for "N:Telerik.Web.UI"]

And the page looks like ss1.gig. Note the twin vertical scrollbars.

SS2.gif shows that the right-hand pane is in a little container of its own.

I initially thought it might just be Chrome, but I got the same thing in IE8.

-- 
Stuart
Georgi Tunev
Telerik team
 answered on 18 Mar 2011
3 answers
260 views
Hello,

I insert table in the Word Processor of RadEditor but table border is missing.
How could i setting the border of table insert into word Processor.

Important thing is table appears the dashed line instead of a solid line.
Please help me as soon as possible.
Thanks.

Best Regards
Mutum Jiten Singh
Akhil Systems Pvt. Ltd.

Marin Bratanov
Telerik team
 answered on 18 Mar 2011
1 answer
110 views
Hello,

Attached is a screen shot of my page.
But what I am wanting to do, and I have not been able to do so.
Is when the user select a node from the treeview I want to display the appropriate grid.
For each node there is a new grid, and depending on which node they choose I want to show that grid, and hide the others.

I have each grid in a RadAjaxPanel, and I have tried setting visiblity to true and false for the panel, and or the grids but it does not seem to work.
I have also tried a snippet of code I found on these forums, but that too does not work for me.
 if (RadGridOSPProposal.Style["display"] != null && RadGridOSPProposal.Style["display"].ToString() == "none")
                    RadGridOSPProposal.Style["display"] = "";
                else
                    RadGridOSPProposal.Style.Add("display""none");  

Thanks for any help, code samples are alway welcome.
KS
Marin
Telerik team
 answered on 18 Mar 2011
1 answer
53 views
upon clicking an event from my monthview, I want to change the date of the dayview I have to that day. I have am trying to pass in the startdate from the database (i.e. dt.Rows[0]["startDate"].ToString()) to the DataStartField. Is there a different method to the madness? SelectedDate but that did not work either.

Thanks,
Mike

 

Peter
Telerik team
 answered on 18 Mar 2011
2 answers
74 views
Currently my schedular is readonly and only the date in the corner is clickable. How do I make the actual event clickable.
Also is there a way to make the entire square clickable as well?

Thanks
Peter
Telerik team
 answered on 18 Mar 2011
5 answers
294 views
Hi Telerik,

I'm using RadFileExplorer in this page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server">
            <Configuration UploadPaths="/Uploads/examples" ViewPaths="/Uploads/examples" DeletePaths="/Uploads/examples"
                MaxUploadFileSize="2097151000"
                SearchPatterns=".jpg" />
        </telerik:RadFileExplorer>
    </div>
    </form>
</body>
</html>

I set SearchPatterns: ".jpg" or "jpg" but I couldn't upload that file with extension "jpg", Please help me
Dobromir
Telerik team
 answered on 18 Mar 2011
5 answers
327 views
Hello,

Refrering to my unanswered thread
http://www.telerik.com/community/forums/aspnet-ajax/compression/radhiddenfieldpagestatecompression-gzip.aspx

and now porting to .net 4.

Being unsure that I am obtaining compressed Viewstate (they are so big), I want to trace on server the fact that the that it is compressed, Fiddler or FireBug can't be used easilly on a production site.


Is there a way to activate some server side trace in Telerik tools or to trace thta Viewstate is going through my .browser file and the control adapter is effectivelly usefd.

Thanks
CS
Simon
Telerik team
 answered on 18 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
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
Iron
Iron
Sergii
Top achievements
Rank 1
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?