This is a migrated thread and some comments may be shown as answers.

[Solved] VB10 Exceptions

2 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jigar
Top achievements
Rank 1
Jigar asked on 01 Aug 2010, 11:30 AM
Hi There,

After reading posts in telerik forums; I started to use vb10 ( vs 2010). In vb10,

1. i saw lot of exceptions in IntelliTrace, like /views/Shared/EditorTemplates/DateTime.aspx
                                                                    /views/Shared/EditorTemplates/String.ascx  etc. while gird.Render() gets executed.

2. My grid loaded successfully, but I couldn't see any operations getting executed; like when I click on "Add New Record" my page just get refreshed, same thing happens while I click "Edit" button.

Please help me regarding this. My code is written as below;

View:
      Dim transGrid = Html.Telerik().Grid(City)().Name("City").Pageable(Function(p) p.PageSize(30).Sortable().Scrollable().Filterable().Groupable().Footer(True)
        
        'Data key assignment
        transGrid.DataKeys(Function(key) key.Add(Function(c) c.id))
        
        'Data Binding Ajax
        transGrid.DataBinding(Function(dataBind) dataBind.Ajax().Select("_Index", "City").Enabled(True) _
                                                                .Insert("_Create", "City").Enabled(True) _
                                                                .Update("_Edit", "City").Enabled(True) _
                                                                .Delete("_Delete", "City").Enabled(True) _
                                                                )
        'Grid will be editable
        transGrid.Editable(Function(e) e.Mode(GridEditMode.PopUp).Enabled(True))
                                 
        'Toolbar Add new Button
        transGrid.ToolBar(Function(cmd) cmd.Insert())
       
        transGrid.Columns(Sub(columns)
                              columns.Bound(Function(c) c.id)
                              columns.Bound(Function(c) c.name)
                              columns.Bound(Function(c) c.description)
                              columns.Bound(Function(c) c.createdbyuserid)
                              columns.Bound(Function(c) c.createddatetime)
                              columns.Bound(Function(c) c.modifieddatetime)
                              columns.Bound(Function(c) c.deleteflag).ClientTemplate("<input type='checkbox' disabled='disabled' name='dflag' <#= deleteflag #>")
                              columns.Command(Sub(cmd)
                                                  cmd.Edit()
                                                  cmd.Delete()
                                              End Sub).Title("Command")
                          End Sub)
    
        transGrid.Render()  

Please help.. Thanks and Regards,

Jigar    

2 Answers, 1 is accepted

Sort by
0
Jigar
Top achievements
Rank 1
answered on 01 Aug 2010, 12:17 PM
Hi There,

After working on my 2nd problem I look for the page source and compared with the telerik example's ( where everything works perfectly fine) source, I found that editors are not being created for my grid columns,

My Source
jQuery('#City').tGrid(
{
  columns:[
  {"title":"Id","member":"id","type":"Number","editor":null},
  {"title":"Name","member":"name","type":"String","editor":null},
  dataKeys:{"id":"id"}, pageSize:30, total:0, currentPage:1, sortMode:'single', ajax:{"selectUrl":"/City/_Index","insertUrl":"/City/_Create","updateUrl":"/City/_Edit","deleteUrl":"/City/_Delete"}});});

Telerik Example's Sources
columns:[
    {"title":"Product name","member":"ProductName","type":"String","editor":"\u003cinput class=\"text-box single-line\" id=\"ProductName\" name=\"ProductName\" type=\"text\" value=\"\" /\u003e\u003cspan class=\"field-validation-valid\" id=\"ProductName_validationMessage\"\u003e\u003c/span\u003e"},
    {"title":"Unit price","member":"UnitPrice","type":"Number","format":"{0:c}","editor":"\u003cdiv class=\"t-widget t-numerictextbox\" id=\"UnitPrice\"\u003e\u003cinput class=\"t-input\" id=\"UnitPrice-input\" name=\"UnitPrice\" style=\"width:100%\" title=\"UnitPrice\" value=\"0\" /\u003e\u003ca class=\"t-link t-icon t-arrow-up\" href=\"#\" tabindex=\"-1\" title=\"Increase value\"\u003eIncrement\u003c/a\u003e\u003ca class=\"t-link t-icon t-arrow-down\" href=\"#\" tabindex=\"-1\" title=\"Decrease value\"\u003eDecrement\u003c/a\u003e\u003c/div\u003e\u003cscript type=\"text/javascript\"\u003e\r\n\tjQuery(\u0027#UnitPrice\u0027).tTextBox({val:\u00270\u0027, step:\u00271\u0027, minValue:\u00270\u0027, maxValue:\u00271000\u0027, digits:2, groupSize:3, positive:0, negative:0, text:\u0027Enter value\u0027, type:\u0027currency\u0027});\r\n\u003c/script\u003e\r\n\u003cspan class=\"field-validation-valid\" id=\"UnitPrice_validationMessage\"\u003e\u003c/span\u003e"},

Is this the problem; why am I not able to see Insert, Edit pages? Please suggest.

If this is the problem; How can i fix it?

thanks & Regards,

Jigar

0
Jigar
Top achievements
Rank 1
answered on 02 Aug 2010, 01:53 PM
Hi there,

I fixed the problem. thanks to Alex Gyoshev.

http://www.telerik.com/community/forums/aspnet-mvc/grid/grid-editing-ajax-problems.aspx

Thanks.

Jigar.
Tags
Grid
Asked by
Jigar
Top achievements
Rank 1
Answers by
Jigar
Top achievements
Rank 1
Share this question
or