Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
96 views
I am wanting to do something like the following but not really sure how.
<mastertableview>
<columns>
column 1
column 2
column 3
</columns>
</mastertableview>

i like the formating of the above but i have one column that has a whole bunch of text so I would like to create a second row and have it span all columns
<mastertableview>
    <row>
        <columns>
            column 1
            column 2
            column 3
        </columns>
    </row>
    <row>
        <columns>
            long column
        </columns>
    </row>
</mastertableview>

how can something like this be done and still keep the column headers from the first set of columns and not have to stick it all in a template column
Princy
Top achievements
Rank 2
 answered on 23 Feb 2010
1 answer
68 views
I want to check if the grid is in editmode on the client side.  I want to be able to prompt a message asking the user to save the changes on the grid before hitting the save button on the form.




Princy
Top achievements
Rank 2
 answered on 23 Feb 2010
2 answers
86 views
Dear Telerik Team,

I am using a RadScheduler control in a RadTabStrip of a user control which is po pout from a RadGrid when clicking New/Edit button in RadGrid. But the RadScheduler control is unable to show it's styles. I am attaching an image of scheduler which exactly showing in tab-strip. Can you please give me a reply as soon as possible.
Pandu
Top achievements
Rank 2
 answered on 23 Feb 2010
3 answers
95 views
Hi all

I have 2 grids on my page, grid1 and grid2. I have a row delete button in grid1. When I click on this delete button I delete the row in grid1 and in my stored proc I also delete any associated data in another table which is grid2.

I am calling the delete button in code behind from the _ItemCommand event of grid1.

 

Protected Sub rgListingWithImages_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgListingWithImages.ItemCommand

 

 

'1. Check which alpha character was selected and then rebind the data to the grid

 

 

'2. Redirect to another page when SalesID, Email, Notes or PwdReset is selected

 

 

Dim value As String = Nothing

 

 

Select Case e.CommandName

 

 

Case ("DeleteRow")

 

 

Dim myItem As GridDataItem = DirectCast(e.Item, GridDataItem)

 

 

Dim CustID As TableCell = myItem("CustomerID")

 

 

Dim OrdID As TableCell = myItem("OrderID")

 

 

Dim ListNo As TableCell = myItem("BusinessListingNumber")

 

 

'Delete specific listing row with slides WS = with slides

 

 

Dim BusList As New BusinessListingsPlanAndPricing

 

BusList.DeleteOneRowInBusinessListings(CustID.Text, OrdID.Text,

CInt(ListNo.Text), "WS")

 

 

'Display listings

 

LoadListingsGridWithSlides()

 

'Price

 

CalculateBusinessCostAndDisplay()

LoadSlidesGrid()

 

Exit Select

 

 

Case ("Select")

 

 

 

Exit Select

 

 

End Select

 

 

End Sub

 



Heres my issue: The data is deleted from the database but grid2 is still displaying the data. I have call a subroutine to refresh the grid datasource but this does not work. It only clears when I click on a delete button in grid2.

How do I call the delete event in grid2 from grid1 to refresh grid2?

many thanks
Chom
Top achievements
Rank 1
 answered on 22 Feb 2010
4 answers
203 views
Hi,

I've come across a few issues when using client-side sorting. I'm managing to work around them all, but just wanted to highlight them, as it would have been ideal if it "just worked like it does server-side" (although perhaps wishful thinking!). I'm working with a grid that has already been in use using server-side binding/sorting, and the query behind the datasource is not 'simple', so for lots of the columns we were using the SortExpression property of columns in markup to get around the fact that it wasn't correct to sort by simply the bound field.
Examples:
-Datafield "ID"; SortExpression "Table.ID" (because of many joins in the actual query)
-DataField "NTextField"; SortExpression "cast(NTextField as nvarchar(3999))" (can't order by an ntext field)
-DataField "Sum"; SortExpression "isnull(number1,0) + isnull(number2,0)"

The issues I've noticed are:
1. The client-side javascript for sorting seems to assume the first space in a sort expression follows a single fieldname to sort on, and that directly afterwards you get the direction if one is present. This isn't the case with some of our sort expressions.
2. It assumes that the fieldname (or maybe it's the columnname) is the same as the first part of the expression up to the space (similar to point 1) which means that when it looks for the sorting buttons it doesn't find them correctly. So using my first example the button might have an id of "gridID__ID__sortAsc" but the sorting functionality looks for "gridID__Table.ID__sortAsc".
3. If there are single quotes in the sort expression (used by sql to indicate strings) then you get javascript errors when the grid first loads, and clicking on the header to sort will cause a postback as it doesn't then call the oncommand event which would normally cancel it in my scenario. Escaping the single quotes (\') did fix the load errors, but then the sortexpression that gets passed to the select is wrong.
4. AllowNaturalSort setting server-side does not carry over to client-side and there doesn't appear to be an equivalent available to set.
5. '+' seems to get removed from the expression altogether (e.g. you might have a field returned that is the sum of 2 underlying numbers).

It would also perhaps be nice to have an OnSort event available?

I've worked around these by removing all our sort expressions from the grid markup and then in the select method swapping out the datafields for the desired sort expression, and hooking into the client-side oncommand event as follows to mimic allownaturalsorting (using telerik RadGridScripts.js as a basis):

    switch (args.get_commandName()) { 
        case 'Sort'// this is to replicate 'allownaturalsorting=false' 
            if (sender.get_masterTableView().get_sortExpressions().toString() == '' && args.get_commandArgument() != '') { 
                var exp = new Telerik.Web.UI.GridSortExpression(); 
                exp.set_sortOrder(Telerik.Web.UI.GridSortOrder.Ascending); 
                exp.set_fieldName(args.get_commandArgument()); 
                var id1 = String.format("{0}__{1}__SortAsc", sender.get_masterTableView().get_id(), args.get_commandArgument()); 
                var id2 = String.format("{0}__{1}__SortDesc", sender.get_masterTableView().get_id(), args.get_commandArgument()); 
                if ($get(id1)) { $get(id1).style.display = ""; } 
                if ($get(id2)) { $get(id2).style.display = "none"; } 
                sender.get_masterTableView().get_sortExpressions().add(exp); 
            } 
            break
    } 
    bindSearchData(sender); 

Of course, I may just be using it in an unexpected way.

Kind regards,

Zoë

Sameer Alibhai
Top achievements
Rank 1
 answered on 22 Feb 2010
9 answers
176 views
I've been working with RadControls for about 6 months now using VB.NET.  I just started a new project and decided to use C# because I'm an old Java programmer and I miss it.  My issue is that the event handlers (e.g., [radcontrol1]_Load()) are not firing in the code-behind.  The only examples I've seen from Telerik put everything in the Page_Load(), which is very lazy programming. Can someone clue me in?  Is there a different syntax for event handling in C# than in VB (besides the obvious brackets, semicolons, case-sensitivity, etc.)?

Thanks,
Mark
Mark Galbreath
Top achievements
Rank 2
 answered on 22 Feb 2010
1 answer
113 views
Whenever I have inserting or editting, e.Appointment.Attributes is always empty.

This is what I have:

  • CustomerID is a value found in my xml field in database
  • Advance Form with added CustomerID
  • OnClientFormCreated

     

    ="schedulerFormCreated" with appropriate javascript

     

     

  • CustomAttributeNames

     

    ="CustomerID"

  • <

     

    AdvancedEditTemplate>

     

     

    <uc1:AdvancedFormCS ID="AdvancedFormCS2" runat="server" Mode="Edit" Subject='<%# Bind("SUBJECT") %>'

     

    Start='<%# Bind("START") %>' End='<%# Bind("END") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' />

     

     

    ... I can't bind CustomerID here either

     

 

 

 

What am I missing?

 

 

 

Sarah
Top achievements
Rank 1
 answered on 22 Feb 2010
2 answers
104 views
Hi, i have a problem, i extracting values from radgrid row and i assign that values to controls in the client side. that works fine in IE but in firefox shows the word "undefined". this is the codeblock that i use.
 <script language="javascript" type="text/javascript"
 
            function RowMouseOver(sender, eventArgs) { 
 
                var dataItem = $get(eventArgs.get_id()); 
                document.getElementById("Cod").innerHTML = dataItem.cells[3].innerText; 
                document.getElementById('DescripNom').innerHTML = dataItem.cells[4].innerText;

                document.getElementById("TxtCod").value = dataItem.cells[3].innerText
                document.getElementById("DDLCodAr").value = dataItem.cells[6].innerText; 
                document.getElementById("TxtDescrip").value = dataItem.cells[4].innerText; 
                document.getElementById("TxtDescShort").value = dataItem.cells[5].innerText; 
                document.getElementById("TxtAus").value = dataItem.cells[8].innerText; 
                document.getElementById("ChBCal").checked = dataItem.cells[9].children[0].children[0].checked; 
                document.getElementById("ChBArFund").checked = dataItem.cells[10].children[0].children[0].checked; 
                document.getElementById("ChBAct").checked = dataItem.cells[13].children[0].children[0].checked; 
                document.getElementById("TxtOPrint").value = dataItem.cells[11].innerText; 
                document.getElementById("TxtPes").value = dataItem.cells[12].innerText; 
            } 
        
        </script> 
i don't have idea why happening this. anybody could help me??... thanks
Jhonattan
Top achievements
Rank 2
 answered on 22 Feb 2010
3 answers
118 views
hi all,
i just want to be sure that i'm working right with the grid..i manipulate data in the code behind, here is the ItemCommand sub

    Private Sub RadGrid2_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid2.ItemCommand  
        If e.CommandName = "Update" Then 
            If Page.IsValid Then 
                Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
                Dim objSection As New Sections(item.GetDataKeyValue("ID"))  
                objSection.SectionName = CType(item.FindControl("txtSectionName"), TextBox).Text  
                objSection.Update()  
                e.Item.Edit = False 
            End If 
        ElseIf e.CommandName = "PerformInsert" Then 
            If Page.IsValid Then 
                Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
                Dim objSection As New Sections()  
                objSection.SectionName = CType(item.FindControl("txtSectionName"), TextBox).Text  
                objSection.LangID = Session("Language")  
                objSection.SiteID = Session("Site")  
                objSection.Insert()  
                e.Canceled = True 
                e.Item.OwnerTableView.IsItemInserted = False 
                e.Item.OwnerTableView.Rebind()  
            End If 
        ElseIf e.CommandName = "Delete" Then 
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
            Dim objSection As New Sections(item.GetDataKeyValue("ID"))  
            objSection.Delete()  
        End If 
    End Sub 

It's functioning well, but i want to be sure that my approach is correct, and there is no easier and better approach to do it.
To be more specific:
1. to get user inputs, i have to use FindControl function right? 

2. to close the popup after success update i have to use
e.Item.Edit = False 

which don't work on insert so after success insert i use 
                e.Canceled = True    
                e.Item.OwnerTableView.IsItemInserted = False    
                e.Item.OwnerTableView.Rebind()    

3. on insert and update i need to use 
Dim item As GridEditableItem = CType(e.Item, GridEditableItem)   

but on delete i use
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  


Wht do u think? am i getting it right?
thnx in advance
robertw102
Top achievements
Rank 1
 answered on 22 Feb 2010
3 answers
87 views
hi my dear friends:
i ajaxified my RadGrid like this :
                            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                                <AjaxSettings> 
                                    <telerik:AjaxSetting AjaxControlID="grdPersonel"
                                        <UpdatedControls> 
                                            <telerik:AjaxUpdatedControl ControlID="grdPersonel"  
                                                LoadingPanelID="RadAjaxLoadingPanel1" /> 
                                        </UpdatedControls> 
                                    </telerik:AjaxSetting> 
                                </AjaxSettings> 
                            </telerik:RadAjaxManager> 
                            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 

i am controling Radgrid AddNewRecord By Myself like this :
        protected void grdPersonel_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
        { 
            switch (e.CommandName) 
            { 
                case RadGrid.InitInsertCommandName: 
                    { 
                        e.Canceled = true
                        hfEditMode.Value = "Insert"
                        ResetForm(); 
                        mvPersonel.SetActiveView(vwPersonelEdit); 
                        break; 
                    } 
            } 
        } 
 

i have some views in my multyview (mvPersonel):
View1 (vwForGird)-> my grid is here.
View2 (vwPersonelEdit)-> I have A table here (with some textboxes and some lables and a save button)for add a new record in grid.
when u press addnewrecord in grid so i reset all of the textboxes in View2 (vwPersonelEdit) and jump to it.
that upper code was working prefectly until i ajaxified my radgrid like upper code.
when i press addnewrecord i recieve this error :

Line: 6
Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

i really really wondering how can i solve this problem ?
how can i force addnewrecord in radgrid to postback after click on it not callback...








Majid Darab
Top achievements
Rank 1
 answered on 22 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?