Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Select 'current row' at databind
posted

Hello

I am trying to use a WebCombo as a record navigation tool because it allows better data display than a standard DropDown. The previous page has a grid of records. When selected the full record details are displayed on the next page (with the WebCombo). Rather than have to return to the previous page I want the user to be able to select the next record from the WebCombo. It works fine, however I want to pre-position the WebCombo at whatever record the page is initially loaded at as it would look more professional plus require less scrolling if the next record is reasonably close to the current record.

 The code I have tried is as follows - using an arbitary value for the test:

wcProcess.DataSource = lNav

wcProcess.DataBind()

wcProcess.SelectedIndex = wcProcess.FindByValue("CRM0020").Row.Index

The error I receive is:

System.NullReferenceException was unhandled by user code
  Message="Object reference not set to an instance of an object."

Can anyone help??

 

Regards

James