vs2005 - winforms - ultragrid
I have a situation where I am trying to capture the row number on the row that is being expanded. When I click on the "+" to expand the child rows, the currentrow returns what row was physically selected, not the row that I am trying to expand. I am trying to capture the current row on the AfterRowExpanded event.
Any help would be fantastic.
Thanks in advance.
Wayne
The event does pass e.row etc but I have not found how to capture the row that you are expanding. You seem to have to select the row then the "+" to beable to capture the current row. My problem is that the users are pressing the "+" without selecting the row. Pressing the "+" expands correctly, but in code I am trying to capture the row number that is being expanded (parent)
I have tried about every code avenue and knowledge base on this subject, but still am coming up empty handed. You are the first to respond to my problem
Hope that makes sense.
Wayne.
Hi Wayne,
One of us is very confused.
If you trap the AfterRowExpanded event and examine e.Row, this should return the row that is being expanded. This may or may not be the active row.
I'm not sure what else to tell you. I just tested this out and it works fine for me.
Are you saying that e.Row is returning the wrong row?
e.Row is always returning the Index a 0 (Zero). Please help me.
If you can post a sample project demonstrating this, I would be happy to take a look at it. But without seeing the behavior, there is no reason I can think of why this would occur.
Hi,
Thanks for your reply. Below is the code that I have used in my project
Design Code:
<igtbl:UltraWebGrid ID="uwg_Test" runat="server" ImageDirectory="/ig_common/Images/"
Style="z-index: 123; left: 500px; position: absolute; top: 240px; width: 340px;"
TabIndex="4" >
<DisplayLayout AutoGenerateColumns="False" BorderCollapseDefault="Separate" ColFootersVisibleDefault="Yes"
Name="uwgxTest" RowHeightDefault="10px" SelectTypeRowDefault="Single"
TableLayout="Auto" Version="2.00" ViewType="Hierarchical">
<AddNewBox Hidden="False">
<style backcolor="LightGray" borderstyle="Solid" borderwidth="1px">
</style>
<BoxStyle BackColor="LightGray" BorderWidth="1px" BorderStyle="Solid">
</BoxStyle>
</AddNewBox>
<Pager>
<PagerStyle BackColor="LightGray" BorderWidth="1px" BorderStyle="Solid"></PagerStyle>
</Pager>
<HeaderStyleDefault BackColor="#4646FF" BorderColor="Black" BorderStyle="Solid" Font-Bold="True"
Font-Names="Arial" Font-Size="10pt" ForeColor="White" HorizontalAlign="Center">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
</HeaderStyleDefault>
<FrameStyle BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Cursor="Default"
Font-Names="Verdana" Font-Size="8pt" Height="75px" Width="345px">
</FrameStyle>
<FooterStyleDefault BackColor="#4646FF" BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial"
Font-Size="10pt" ForeColor="White" HorizontalAlign="Left">
</FooterStyleDefault>
<EditCellStyleDefault BackColor="White" BorderStyle="None" BorderWidth="0px" ForeColor="Red"
VerticalAlign="Top">
</EditCellStyleDefault>
<SelectedRowStyleDefault BackColor="Black" ForeColor="White">
</SelectedRowStyleDefault>
<Images ImageDirectory="/ig_common/Images/">
</Images>
<RowAlternateStyleDefault BackColor="#6262FF" Font-Names="Arial" Font-Size="10pt"
ForeColor="White" HorizontalAlign="Left">
</RowAlternateStyleDefault>
<RowStyleDefault BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Arial" Font-Size="10pt" ForeColor="Black">
<Padding Left="3px" />
<BorderDetails ColorLeft="Gray" ColorTop="Gray" WidthLeft="0px" WidthTop="0px" />
</RowStyleDefault>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
</DisplayLayout>
<Bands>
<igtbl:UltraGridBand>
<Columns>
<igtbl:UltraGridColumn BaseColumnName="ID" Hidden="True" Key="ID"
Width="0px">
<Footer Key="ID">
</Footer>
<Header Key="ID">
</Header>
</igtbl:UltraGridColumn>
<igtbl:UltraGridColumn BaseColumnName="Year" HeaderText="Year" Key="Year"
Width="75px">
<Footer Key="Year">
<RowLayoutColumnInfo OriginX="1" />
<Header Caption="Year" Key="Year">
<igtbl:UltraGridColumn BaseColumnName="StatusCode" HeaderText="Status"
Key="StatusCode" Type="Custom" Width="273px">
<Footer Key="StatusCode">
<RowLayoutColumnInfo OriginX="2" />
<Header Caption="Status" Key="StatusCode">
<igtbl:UltraGridColumn BaseColumnName="AgreementID" HeaderText="Agreement ID"
Hidden="True" Key="AgreementID" Width="0px">
<Footer Key="AgreementID">
<RowLayoutColumnInfo OriginX="3" />
<Header Caption="Agreement ID" Key="AgreementID">
</Columns>
<AddNewRow Visible="NotSet" View="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
</igtbl:UltraWebGrid>
Code Behind:
Protected Sub uwg_Test_UpdateRowBatch(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles uwg_Test.UpdateRowBatch
Dim Index As Integer
Index = e.Row.Index
End Sub
The Index is returnig as 0(Zero) even if update row 1, 2 , 3 and go on… So If I update a record for the row 2 or 3, its getting updated in row 0
This forums is for UltraWinGrid. I'm afraid I know nothing about UltraWebGrid. You should post your question on the UltraWebGrid forum.
I am sorry. Thanks for your valuable support.