Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
187 views
Hi,

I have a grid that binds to a dataset with approx. 100 rows and 40 columns.  I'm NOT using paging for this application for a number of reasons.  The grid shows 10 rows vertically and 12 columns horizontally.  So, users scroll vertically and horizontally to view the data.  I also have columns 1 to 3 set as "frozen" columns.

As an example, the user may scroll right to see columns 20-27 (along with frozen columns 1 to 3) and then scroll down to see rows 20-30.  At that time, the user selects row 25 (row click  action) from the grid.  The row is highlighted.  Through the ItemComand event, the application displays the data (columns) for the row in a separate "edit" panel (an AJAX action).  User then edits data of the row in the "edit" panel, clicks a SAVE button (a postback action) to save the changes.  The changes are then written to the database; a fresh dataset is retrieved from the database and the grid is re-bound to the dataset.  Relatively simple.  Eveything works as planned. 

Questions:

1.  At the end of the postback action, the grid is refreshed and naturally the grid now goes back to the top, i.e. row 1 and columns 1 to 10.  I would like to keep the grid's previous scroll position (both veritical and horizontal), so that the user sees the grid just as prior to the edit action, i.e. in this example, grid would display rows 20 to 30, columns 20 to 27, with row 25 highlighted.  How do I accomplish that?

2. A related question:  I have enabled column resizing.  However, I find that the the "<--> drag to resize icon" doesn't always show up when and where I'd expect it to.  For most columns, it shows when the mouse hovers over the column divider in the header (normal behavior I believe).  For some columns, this doesn't work.  In those cases, I have to move the mouse around and sometimes it would show when the mouse hovers at the bottom of the column header and sometimes it wouldn't show at up.  The behavior is inconsistent.  Users will get very confused and frustrated with this.  Does anyone have an explanation or solution for this?

Thanks for any advise.

Barry
Pavlina
Telerik team
 answered on 08 Sep 2009
3 answers
92 views
Hi,

I have  a grid created on the Page_Init method and the grid is populated client side from a webservice when I try and used drag n drop i get an exception on the server

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
   at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.organisationalviews2_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\8c660e17\2b7f802b\App_Web_nrp1nnrc.16.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

the drag n drop was working fine, but it seems to have broken since I converted the grid to be created at run time. I have also completed disconnected the clientside row dropping event and serverside RowDrop event but i still get this exception.

any ideas?.

Toby
Top achievements
Rank 1
 answered on 08 Sep 2009
5 answers
115 views
Hi

I encountered the effect that the RadGrid PopUp isn't shown if the RadSplitter in which the grid resides has the VisibleDuringInit property set to false. The popup has display: none (IE) or a negative offset (FF) is this set to false. 
I asume this is a bug and will be fixed as having the content moving around during load/resize of the splitter is ugly and confusing...

greetings
Tunde Adefowoju
Top achievements
Rank 1
 answered on 08 Sep 2009
1 answer
141 views
<telerik:GridGroupByField Aggregate="Avg" FieldAlias="BudgetBal" FieldName="EstCost"
                                        FormatString="{0:c}" />


I hv one column that contains some product value, when i calculate that value sometimes it goes in minus. when it in minus it will not shown minus condition. 

i want to show the value Minus if in miuns

like this
Balance Value = 3000  if not minus
balnce value = -6000 if caluctiaon goes in minus but now it shows like this Balance = 6000

Reply please urgent
Yavor
Telerik team
 answered on 08 Sep 2009
3 answers
153 views
Hi guys,

I wonder when you have an error like this, what is the best way to track it down to the exact RadComboBox in the Grid?

Message:  name is neither a DataColumn nor a DataRelation for table pv_contracts.

Trace:  at System.Data.DataRowView.get_Item(String property) at Telerik.Web.UI.PropertyDescriptorCache.GetPropertyValue(Object dataItem, String propertyName) at Telerik.Web.UI.PropertyDescriptorCache.GetPropertyValue(Object dataItem, String propertyName, String format) at Telerik.Web.UI.ControlItem.PopulateFromDataItem(PropertyDescriptorCache propertues, Object dataItem, String dataMember, Int32 depth) at Telerik.Web.UI.RadComboBoxItem.PopulateFromDataItem(PropertyDescriptorCache properties, Object dataItem, String dataMember, Int32 depth) at Telerik.Web.UI.ControlDataBinder.SetItemPropeties(ControlItem item, Object dataItem, String dataMember, Int32 depth) at Telerik.Web.UI.ControlDataBinder.BindItem(ControlItemCollection items, Object dataObject, Object dataItem, String dataMember, Int32 depth) at Telerik.Web.UI.ControlDataBinder.BindItem(ControlItemCollection items, Object dataItem, String dataMember, Int32 depth) at Telerik.Web.UI.ControlDataBinder.BindToEnumerableData(IEnumerable dataSource) at Telerik.Web.UI.ControlItemContainer.PerformDataBinding(IEnumerable data) at Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) at Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) at Telerik.Web.UI.RadComboBox.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridDropDownListColumnEditor.DataBind() at Telerik.Web.UI.GridDropDownColumn.OnDataBindColumn(Object sender, GridCellDataBoundEventArgs args) at Telerik.Web.UI.GridCellDataBoundEvent.Invoke(Object sender, GridCellDataBoundEventArgs args) at Telerik.Web.UI.GridItem.OnCellDataBound(GridColumn column, TableCell cell) at Telerik.Web.UI.GridItem.CellsDataBound(GridColumn[] columns) at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode) at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) at Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thank you.

Bruno Alexandre
(using Søren's account)


Sebastian
Telerik team
 answered on 08 Sep 2009
1 answer
130 views
To populate a grid, I call an asmx web service and get back the following JSON string from the JavaScript deserializer:

[{"CustomerId":"ALFKI","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":"","PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"}]

This is grid which is consuming the data:

        <telerik:RadGrid ID="GridCustomers" 
                runat="server" 
                AllowFilteringByColumn="true" 
                GridLines="None" 
                AllowPaging="true" 
                AllowSorting="true">
            <ClientSettings>
                <DataBinding Location="http://localhost/Niit/CustomerServices.asmx" 
                    EnableCaching="true" 
                    SortParameterType="Linq" 
                    SelectMethod="GetCustomers" 
                    SelectCountMethod="GetCount">
                    <DataService TableName="Customers" />
                </DataBinding>
            </ClientSettings>                
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="CustomerId" DataField="CustomerId" HeaderText="Customer ID" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

At run time, I get an exception in the Telerik JavaScript file when this line of code is executed:

var x=this._dataSource[y][t];  // this line appears before "function U()"

This is the value of this._dataSource in the watch window:

this._dataSource = "[{"CustomerId":"ALFKI","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":"","PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"}"; 

Any ideas as to why I'm getting this exception?

Thanks in advance.


Nikolay Rusev
Telerik team
 answered on 08 Sep 2009
1 answer
845 views
Is it possible to do  a row span to  a column in radgrid item row(not header row)?
It should look as follows:


__________________________________________________________
|Description                                            |                   target                        |
|__________________________________________________________|
|Description  1                                          |                   2 | 3 |
|                                       |                4 | 5 |
|                                       |                   7 | 9 |
_____________________________________________________________
|Description  1                                          |                5    | 94 |
|                                          |             6       | 8 |
|                                        |               7     | 3 |
______________________________________________________________

I can send you the screen shot of the format I need if needed. I added the table this way , since there is no way to post image in the thread.

Thanks

Shiza
Princy
Top achievements
Rank 2
 answered on 08 Sep 2009
2 answers
244 views
Hi All,

When the RAdToolBar Button is clicked , i need to invoke the javascript function. I tried to do in the below method but javascript function is not getting called!! pls help
this is ascx(since I'm using an user ctrl)

<

 

script type="text/javascript">

 

 

function DateValid()

 

{

alert(

"End Date cannot be lesser than the Start Date");

 

}

and in ascx.cs, I have the below lines to call the js function.

 

 

if (obDoSchedule.DtStartDate >= obDoSchedule.DtEndDate)

 

{

ctlButtonBar.Attributes.Add(

"onClick", "return DateValid();");

 

}

Is this correct? I'm not getting the javascript alert msg even if DtStartDate >=DtEndDate.Pls help!!

Sameh
Top achievements
Rank 1
 answered on 08 Sep 2009
1 answer
59 views
Hi All,

I am working on a case which is copying the example 

Grid / Editing with external form


In which the grid is in a user control (ascx) and the external form is in the hosting page(aspx). However my .aspx  is using masterpage.

 I got reference error when try to access controls in the hosting page from the .ascx like:

 this.Page.FindControl("pnlExternalForm").Visible = true;//code in .ascx
pnlExternalForm is in the hosting .aspx page

The codes works fine if I put them into a case without masterpage.

I think the code is right, but just not work

Any idea?

TIA

Jerry


         
Yavor
Telerik team
 answered on 08 Sep 2009
4 answers
175 views
Hi,

If i try to select multiple rows in a grid by pressing Shift Key, OnSelectedIndexChanged event is not firing (However rows are getting selected). But this works properly with ctrl key. Can someone help me in this regard?

I am using "Telerik.Web.UI.dll" version: 2009.1.402.35

Regards,
Rajiv.
Yavor
Telerik team
 answered on 08 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?