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.
Well there lies the confusion. On the expanded row if I try to capture the row number, it only gives me the row that was last selected, not the current one.
For example:
I select a row in the grid. I can capture that row number (Row 3 for example). Now when I select the "+" on another row (not row 3) to expand the child rows, and in the event of AfterRowExpanded I try to capture the row number (of that parent row), I get returned Row 3. It is like I have to select a row for it to return the row number. By why can't I capture the correct row number on a row that I only press on the "+" ?
....
Me.grdAllProposals.Rows(Me.grdAllProposals.ActiveRow.RowSelectorNumber)
.....
I am sorry. Thanks for your valuable support.
Hi,
This forums is for UltraWinGrid. I'm afraid I know nothing about UltraWebGrid. You should post your question on the UltraWebGrid forum.
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
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.
e.Row is always returning the Index a 0 (Zero). Please help me.