Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
475 views
Hello
I have a radgrid which is build from a cross table.
I need the get column's value, from the Radgrid_ItemCommand. The thing is that I don't know the whole name of the column. I only know the first 3 characters ("TRA") of the column.
Here is my code
Private Sub RadGrid1_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand  
        If e.CommandName = "UpdateAll" Then 
            For Each editedItem As GridEditableItem In RadGrid1.EditItems  
                Dim newValues As New Hashtable()  
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)  
                SqlDsIntervenant.InsertCommand = String.Format("INSERT INTO T_COMPTENCES_TRANVERSALES (FICHE, MAT, GRP, NO_INTERV, COMPTENCES, NOM, PRENOM) VALUES (" & newValues("FICHE") & ",'" & newValues("MAT") & "', '" & newValues("GRP") & "', '" & newValues("NO_INTERV") & "', '" & newValues("COMPTENCES") & "','" & newValues("NOM") & "','" & newValues("PNOM") & "')")  
                SqlDsIntervenant.Insert()  
 
                editedItem.Edit = False 
            Next 
        End If 
        RadGrid1.Rebind()  
    End Sub 
Does somebody know how to get that?
Thank you!
Myriam
Top achievements
Rank 1
 answered on 26 May 2009
0 answers
93 views
Hi i am using a radUpload control in a ajaxify panelbar. I came to know across seeing many forums since there is no post back the upload control always gives the count as "0". Later when i searched across i got a link which said how to used the upload control in the ajaxify panel bar. I tried the way but didn't get any changes. The link is
"http://www.telerik.com/help/aspnet-ajax/upload_uploadingajax.html"

in the topic "Alternative workaround for RadAjaxPanel (and RadGrid classic)"
I have a doubt in this code.. the CodeBehind says to create a click event..

protected void Page_Load(object sender, EventArgs e)
{
 
if (!IsPostback)
 {
   GetPostBackEventReference(
this);
   ButtonSubmit.Attributes.Add(
"onclick",
     
string.Format("realPostBack('{0}', ''); return false;", ButtonSubmit.UniqueID));
 }
}


The script code is

function realPostBack(eventTarget, eventArgument)
 {
   __doPostBack(eventTarget, eventArgument);
 }

Why do we send a single argument. i mean we just send the eventTarget  and get eventArgument  also which is always null. I am not clear in this.. if some one gets this to work please help me out in this as i am stuck in it.. and more over the solution given here is not working for me. :(

thanks in advance
arun.m
Arun
Top achievements
Rank 1
 asked on 26 May 2009
1 answer
77 views
What is use of this forum? I never get answer of any single question since march 2009.

Its better to close this forum.

Thankyou very much
Daniel
Telerik team
 answered on 26 May 2009
9 answers
444 views
I followed the steps describe in the following like:

The expand and collapse images still show up.  Is there any other way to get it to work?

Thanks in advance,
Calvin
Daniel
Telerik team
 answered on 26 May 2009
4 answers
126 views

I use GridColumn Collection editor to set CSS classes because I need to style columns differently (just right/left alignment of text actually).

If default pagesize is 10 and I use the page control to select 20 or 50 then rows 11-20 / 11-50 are not styled.
If default pagesize is 20 and I select 50 then 21-50 are not styled.

If I do not set CSS classes in GridColumn Collection editor and instead set a css class in RadGrid properties then all additional rows are styled but then all columns are of course styled using same class.

Has anyone encountered this problem? What can be done to fix it?
Martin
Top achievements
Rank 1
 answered on 26 May 2009
1 answer
89 views

I have to close a rad doc,in a button press

What should I do for this?

 

We can close rad docs using close button on the right hand side of every raddock

But I want to close a rad dock in a button click

I am expecting some thing like

Sub Button1_click(………..)

 

RaddockLayout.findcontrol(“raddoc1”).close()

 

End sub

 

I also need a way to open a rad doc in another button click

It this two possible?

 

 

The reason why I asking this is because

 

I am trying to implement some thing like in the site

http://www.bbc.co.uk/  press “Add more to this page”

It shows only the web part for which we ticked.

 

One solution is to load   docs dynamically (in vb codes) depending up on check boxex.

But I don’t like to load all dynamically.

 

 

NB:I am  implementing personalization well working

 

Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 26 May 2009
2 answers
99 views
Hi,
I have a page with a tree-view and two context menus that are not visible by default. When I select an item in the tree, I get a javascript error: 'Telerik.Web.UI.RadContextMenu is null or not an object'. I've fixed it for now by adding a "dummy" context-menu with no items in it (but with the Visible property set to 'true'), but I would like to know if there is a better solution.

Thanks.
Veselin Vasilev
Telerik team
 answered on 26 May 2009
1 answer
243 views
Hi,

I want to format an ItemTemplate conditionally but can't find a way to get archieve this.

I've read the Conditional Formatting for rows/cells on ItemDataBound topic but can't apply it to an ItemTemplate.

For example my aspx code:

                    <ItemTemplate> 
                        <span style="display: block; float: left;"
                            <%# Eval (Session["ntyp"].ToString())%> 
                        </span>
                        <
span style="display: block; float: right;"
                            <%# Eval("date")%> 
                        </span> 
                        <br /> 
                        <span> 
                            <%# Eval("subject")%> 
                        </span> 
                    </ItemTemplate> 

All what I want to do is, give the "subject" an individul style, depending on the value of "read" which is stored in the same table (not visible to users here) and could be empty or a string.

If I use a simple if statement checking the value using Eval("read") inside the ItemTemplate it trhows a TargetInvocationException.

Any help would be appreciated.

Regards
Sebastian
Telerik team
 answered on 26 May 2009
3 answers
258 views
Hi, I was wondering if there is a solution for the following problem I'm having?

I have an asp.net function which encrypts data using AES 256bit. I'm then storing this encrypted data within varbinary fields in SQL Server.

The problem I'm having is filtering these values with RadGrid - the error reported is Sys.WebForms.PageRequestManagerServerErrorExcept is neither a DataColumn nor a DataRelation for table DefaultView.

For columns I'm using GridTemplateColumn type so I can decrypt and display the data correctly:

 <Columns> 
     <telerik:GridTemplateColumn UniqueName="UserID" SortExpression="UserID" HeaderText="UserID" DataType="System.String">    
        <ItemTemplate><%#cs_lib.Decrypt(Eval("UserID"), SqlDataSource1.SelectCommand, 3)%></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>  
        <telerik:GridTemplateColumn UniqueName="FirstName" SortExpression="FirstName" HeaderText="FirstName" DataType="System.String">    
        <ItemTemplate><%# cs_lib.Decrypt(Eval("FirstName"), sqlDataSource1.SelectCommand, 3) %></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>   
          <telerik:GridTemplateColumn UniqueName="Surname" SortExpression="Surname" HeaderText="Surname" DataType="System.String">    
        <ItemTemplate><%#cs_lib.Decrypt(Eval("Surname"), SqlDataSource1.SelectCommand, 3)%></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>   
          <telerik:GridTemplateColumn UniqueName="EmailAddress" SortExpression="EmailAddress" HeaderText="EmailAddress" DataType="System.String">    
        <ItemTemplate><%#cs_lib.Decrypt(Eval("EmailAddress"), SqlDataSource1.SelectCommand, 3)%></ItemTemplate>    
        <ItemStyle/>   
        </telerik:GridTemplateColumn>   
        <telerik:GridDateTimeColumn DataField="DateCreated" DataType="System.DateTime"   
            HeaderText="Created" SortExpression="DateCreated" UniqueName="DateCreated" ItemStyle-Width="175px" HeaderStyle-Width="175px"
        </telerik:GridDateTimeColumn> 
        <telerik:GridCheckBoxColumn DataField="SecurityAdmin" HeaderText="Security Admin"  
            SortExpression="SecurityAdmin" UniqueName="SecurityAdmin"   
            DataType="System.Boolean"
        </telerik:GridCheckBoxColumn >         
                <telerik:GridHyperLinkColumn AllowFiltering="False"  
            DataNavigateUrlFields="UserID" Groupable="False" Text="Delete"  
            UniqueName="DeleteColumn"
        </telerik:GridHyperLinkColumn> 
        <telerik:GridHyperLinkColumn AllowFiltering="False"  
            DataNavigateUrlFields="UserID" Groupable="False" Text="Edit"  
            UniqueName="EditColumn" DataNavigateUrlFormatString="edit.aspx?userid={0}"
        </telerik:GridHyperLinkColumn> 
        </Columns> 

The filtering was working correctly before I started using varbinary fields types and AES encryption.

Is anyone aware of a possible solution for this?

Thanks
Mark
Sebastian
Telerik team
 answered on 26 May 2009
1 answer
349 views
I have a radGrid and I am doing client-side binding. And I am using
PagerStyle Mode="NextPrevAndNumeric"

So when client changes the pageSize and I am trying to pass that information to my webservicerequest to get the new set of items as per that new pageSize as below

function RadGrid1_Command(sender, args) {
                //debugger;
                args.set_cancel(true);
                commandName = args.get_commandName();

                var searchText = $('.SearchText').val();
                var searchType = $('.SearchType').val();
                var searchId = $('.SearchID').val();
                var newPageSize = tableView.get_pageSize();
                tableView.set_pageSize(newPageSize);

                ISearchResultsService.getSearchResults(searchText, tableView.get_currentPageIndex(),
                            tableView.get_pageSize(), tableView.get_sortExpressions().toString(),
                            tableView.get_filterExpressions().toDynamicLinq(), searchType, searchId, updateGrid, onGetDataFailure2);
}

but I am manipulating columns in as below

function RadGrid1_RowDataBound(sender, args) {
                var imgbutton = args.get_item().findElement("img1"); // find control
                if (args.get_dataItem()["amazonThumbnailUrl"] != null && args.get_dataItem()["amazonThumbnailUrl"].toString() != "") {
                    imgbutton.src = args.get_dataItem()["amazonThumbnailUrl"].toString();
                }
                else {
                    imgbutton.src = "../Images/Listing/Thumbnails/" + args.get_dataItem()["ImageName"].toString();
                }
            }


But the HTML has only the initial pageSize and when it tries to rowDataBind the oldPageSize +1  it crashes since it cant find a value for Imgbutton in the above code, So what is work around for this situation to be able to change the pageSize in client side binding. I have also opened a support ticket, but thought posting here too for any workarounds?

Thanks
Georgi Krustev
Telerik team
 answered on 26 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?