|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
I'm moving an old website that contains an <asp:datagrid> and I'm trying to place it inside a Dialog. It is possible to place the datagrid inside a Dialog box? If so, why is not showing up. I may be able to use an EO.Grid but I just wnat to know if this is possible or if any have had this experience before.
Thanks in advance.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
We are not aware of any problem with Grid in Dialog. Can you create a test page that demonstrates the problem?
Thanks
|
|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
Here, I put the Grid inside the content template of the Dialog1 like this;
<ContentTemplate> <div id="LiveDiv" style="margin-left:auto; margin-right:auto; font-family:Verdana; color:Black;"> <eo:Grid ID="Grid1" runat="server" BorderColor="#C7D1DF" BorderWidth="1px" ColumnHeaderAscImage="00050303" ColumnHeaderDescImage="00050304" ColumnHeaderDividerImage="00050302" FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="9pt" Font-Strikeout="False" Font-Underline="False" GridLineColor="199, 209, 223" GridLines="Both" Height="400px" ItemHeight="19" Width="100%"> <ItemStyles> <eo:GridItemStyleSet> <ItemStyle CssText="background-color: white" /> <CellStyle CssText="padding-left:8px;padding-top:2px; color:#336699;" /> <SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" /> <AlternatingItemStyle CssText="background-color:info;" /> <ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" /> </eo:GridItemStyleSet> </ItemStyles> <FooterStyle CssText="padding-bottom:4px;padding-left:4px; padding-right:4px;padding-top:4px;" /> <Columns> <eo:StaticColumn HeaderText="Full Name" DataField="FullName"> </eo:StaticColumn> <eo:StaticColumn HeaderText="Loan #" DataField="Loan"> </eo:StaticColumn> <eo:StaticColumn HeaderText="Device ID" DataField="Codigo"> </eo:StaticColumn> </Columns> <ColumnHeaderStyle CssText="background-image:url('00050301'); padding-left:8px;padding-top:2px;font-weight: bold;color:white;" /> </eo:Grid> </div> </ContentTemplate> This is my code behind... But I get Object not set to reference of an object... I can't reference the Grid from my Codebehind page.... Am I missing somethin else????
private void BindLive() { try { string sql = "SP_DEVICELISTLIV_ADMIN '%%', 0"; BDados bd = ((BDados)Session["bd"]); bd.CommandText = sql; Grid1.DataSource = bd.ExecuteReader(); Grid1.DataBind(); } catch (Exception exc) { lblComandoExec.Text = "Error: " + exc.Message; } }
Thanks in advance...
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
You won't be able to use "Grid1" directly. You will need to use:
EO.Web.Grid grid = (EO.Web.Grid)Dialog1.ContentContainer.FindControl("Grid1"); grid.DataSource = ....
Thanks
|
|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
Thanks...
|
|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
Ok Same scenario. I'm able to cast the Grid and Bind the data. But now if I want to add a Button Culumn into the grid and do some code to it (i.e. a Remove link to delete a row) I have to use the OnItemCommand of the grid but every time I click on the column is no going into the OnItemCommand. Now if I put the Grid outside the dialog it will work.
As you can see on the source code the Grid is inside the dialog as part of the content template and every time I want to see it on design view I get an error "An Error occurred while rendering the control" so I can not access its properties.
I thing what I'm trying to accomplish is to be able to reach the server side code when the Grid or any control is inside of a Dialog.
Thanks in advance...
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
The easiest way for you to work around this is to get the event handler to work outside of the dialog and then move the Grid inside the dialog. You may need to modify the designer generated code after you moved the Grid inside the dialog, specifically, if you see some code like this:
Grid1.OnItemCommand += ......
You will replace Grid1 according to our previous reply. Once you replace that, move it outside of Page_Init so that it no longer interfers with the designer.
The basic rule is still the same: You can no longer reference "Grid1" directly.
If you continue to have problem on this issue, you may wish to seek help from other resource. We do view this as a generic ASP.NET programming issue that is technically out of the scope of our support.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
Yes it is an ASP programming but involves one of your controls. I'm just trying to get the best of them. that's all!
|
|