Hi,
I have a webgrid on my form with number of columns. I set two columns with webcombo1 and webcombo2.
When I select an item from Webcombo1, Webcombo2 populated with data. This is fine for the first time. BUT, after selecting another row and try to repeat the same action, it throws this error message "Rowtoquery is null or not an object".
What should I do to fix this error?
Thanks in advance.
Kamal
I'm not sure, but this sounds like one of those situations where you're trying to handle something in the wrong event handler. If your WebCombos are in templated columns, I believe you would need to bind them during the InitializeRow event.
If that doesn't help, posting your markup and your code would give all of us a chance to spot the problem.
Thanks for replying back. I tried your suggestion but now I get "Element is null or not an object" error for each row. my ASPx code is here:
DataSourceID="dsMddDataMap" Height="200px"
Width="700px" oninitializerow="UltraWebGrid1_InitializeRow">
<Bands>
Key="LookupMDD">
<Columns>
IsBound="True" Key="LookupRDBID" Hidden="True">
<Header Caption="LookupRDBID">
</Header>
</igtbl:UltraGridColumn>
IsBound="True" Key="Surveycode" Hidden="True">
<Header Caption="Surveycode">
<RowLayoutColumnInfo OriginX="1" />
<Footer>
</Footer>
Key="ElementName">
<Header Caption="ElementName">
<RowLayoutColumnInfo OriginX="2" />
Key="VariableName">
<Header Caption="VariableName">
<RowLayoutColumnInfo OriginX="3" />
IsBound="True" Key="VariableID">
<Header Caption="VariableID">
<RowLayoutColumnInfo OriginX="4" />
IsBound="True" Key="Response">
<Header Caption="Response">
<RowLayoutColumnInfo OriginX="5" />
Key="PTKVariable" Hidden="True">
<Header Caption="PTKVariable">
<RowLayoutColumnInfo OriginX="6" />
Hidden="True">
<Header Caption="CCP">
<RowLayoutColumnInfo OriginX="7" />
<Header Caption="FixValue">
<RowLayoutColumnInfo OriginX="8" />
IsBound="True" Key="DateAdded">
<Header Caption="DateAdded">
<RowLayoutColumnInfo OriginX="9" />
IsBound="True" Key="DateModified">
<Header Caption="DateModified">
<RowLayoutColumnInfo OriginX="10" />
IsBound="True" Key="DateDeleted">
<Header Caption="DateDeleted">
<RowLayoutColumnInfo OriginX="11" />
IsBound="True" Key="IsValid" Type="CheckBox">
<Header Caption="IsValid">
<RowLayoutColumnInfo OriginX="12" />
IsBound="True" Key="Verified" Type="CheckBox">
<Header Caption="Verified">
<RowLayoutColumnInfo OriginX="13" />
IsBound="True" Key="IsLock" Type="CheckBox">
<Header Caption="IsLock">
<RowLayoutColumnInfo OriginX="14" />
Key="MDDFileName" Hidden="True">
<Header Caption="MDDFileName">
<RowLayoutColumnInfo OriginX="15" />
Key="VariableText">
<Header Caption="VariableText">
<RowLayoutColumnInfo OriginX="16" />
Type="DropDownList">
<Header Caption="MapTable">
<RowLayoutColumnInfo OriginX="17" />
<Header Caption="MapField">
<RowLayoutColumnInfo OriginX="18" />
IsBound="True" Key="MapLen">
<Header Caption="MapLen">
<RowLayoutColumnInfo OriginX="19" />
<igtbl:UltraGridColumn BaseColumnName="WMDvalue" IsBound="True" Key="WMDvalue">
<Header Caption="WMDvalue">
<RowLayoutColumnInfo OriginX="20" />
</Columns>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
FixedHeaderIndicatorDefault="Button" LoadOnDemand="Xml" Name="UltraWebGrid1"
Version="4.00" AllowColSizingDefault="Free" SelectTypeCellDefault="Single"
SelectTypeRowDefault="Single" ViewType="OutlookGroupBy">
<FrameStyle Height="200px" Width="700px">
</FrameStyle>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
</DisplayLayout>
</igtbl:UltraWebGrid>
EnableXmlHTTP="True" SelBackColor="" SelForeColor="" Version="4.00"
onselectedrowchanged="cmboTables_SelectedRowChanged">
<igtbl:UltraGridColumn IsBound="True" BaseColumnName="tblname" Key="tblname">
<Header Caption="tblname">
<ExpandEffects ShadowColor="LightGray"></ExpandEffects>
XmlLoadOnDemandType="Accumulative" DropdownWidth="135px">
<FrameStyle Height="130px" Width="325px"></FrameStyle>
</DropDownLayout>
<igcmbo:WebCombo ID="cmboColumnname" runat="server" DataSourceID="dsColumnName"
EnableXmlHTTP="True" SelBackColor="" SelForeColor="" Version="4.00" DropDownLayout-DropdownWidth="170px" DropDownLayout-ColWidthDefault="150px">
Key="Databound Col0">
<Header Caption="Databound Col0">
IsBound="True" Key="Databound Col1">
<Header Caption="Databound Col1">
Key="Databound Col2">
<Header Caption="Databound Col2">
<ExpandEffects ShadowColor="LightGray" />
XmlLoadOnDemandType="Accumulative" DropdownWidth="195px">
<FrameStyle Height="130px" Width="170px">
</igcmbo:WebCombo>
and my code behind is:
{
//make sure the grid allows for editing
//this.UltraWebGrid1.DisplayLayout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes;
//assign the webcombo as an editor for the CategoryID column in the grid
this.UltraWebGrid1.DisplayLayout.Bands[0].Columns.FromKey("MapTable").EditorControlID = this.cmboTables.UniqueID;
}
try
catch
Thanks.