Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

In using the datagrid, I am unable to get a postback from it

 

You can click the rows until your fingers bleed and the postback doesn't fire. I find nothing to enable

 

I am not using AutoGenerate columns. I do dynamically bind the data after a button even has occurred. What I want is for my end user to click a row and to activate the dg.SelectedItemChanged event, which is does not do

 

The sub procedure for this event DOES use the proper event handler.

 

Any idea?

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted

<DIV id="lblEmails" style="DISPLAY: inline; OVERFLOW: auto; WIDTH: 577px; HEIGHT: 230px"
runat="server" ms_positioning="FlowLayout"><asp:datagrid id="dgInbox" runat="server" Width="572px" BackColor="White" Font-Name="MS Sans Serif"
HorizontalAlign="Center" OnItemCommand="ShowBod" CellPadding="4" AutoGenerateColumns="False" OnEditCommand="ShowMail" Font-Size="2pt" Font-Names="MS Sans Serif">
<SelectedItemStyle BackColor="Yellow"></SelectedItemStyle>
<AlternatingItemStyle BackColor="White"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="Black" BackColor="#EEEEEE"></HeaderStyle>
<Columns>
	<mbrsc:RowSelectorColumn SelectionMode="Single" AllowSelectAll="false"></mbrsc:RowSelectorColumn>
	<asp:BoundColumn DataField="Sender" HeaderText="Sender/Recipient">
		<FooterStyle Width="200px"></FooterStyle>
	</asp:BoundColumn>
<asp:BoundColumn DataField="MailRef" HeaderText="Subject">
		<FooterStyle Width="230px"></FooterStyle>
	</asp:BoundColumn>
	<asp:BoundColumn DataField="Read" HeaderText="Read">
		<FooterStyle Width="30px"></FooterStyle>
	</asp:BoundColumn>
	<asp:BoundColumn DataField="MailDate" HeaderText="Date">
	<FooterStyle Width="100px"></FooterStyle>
</asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="RecId" HeaderText="RecID"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="Body" HeaderText="RecID"></asp:BoundColumn>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="" CancelText="" EditText="Open"></asp:EditCommandColumn>
</Columns>
</asp:datagrid></DIV>

 

I have tried it without the Div as well - doesn't work

 

The mbrsc is a Column Counter which I have also tried removing, but which will not then enable the postback

 

Thanks for your effort on this!

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted

Hi,

 

Try setting the datagrid's AutoPostback property to true.

 

Then, in the event handler's methods, for (e.g edit click event) check if the "Handles datagrid1.clicked" is present.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...