CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 9/30/2004 2:55:57 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 21 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
threecrans
Asp.Net User
How do you replace a TableCell with Custom TableCell in a DataGrid when databinding?9/30/2004 2:55:57 PM

0/0

I'm creating a custom grid that derives from DataGrid. I also have a custom TableCell class which derives from TableCell. Does anyone know the easiest way to replace the TableCell that ASP.NET creates automatically when databinding with my custom TableCell.

I got pretty far by overriding the InitializeCell method of my custom BoundColumn class...but just couldn't get it to work (no matter what, although when the InitializeCell function exited my custom TableCell was properly created, when it rendered it always rendered as if it were an default TableCell with no properties set). Anyone have any ideas on how to do this?
1 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
CodeProject: Merging Datagrid Header Column. Free source code and ... Jan 7, 2007 ... The condition is used to check if a custom table cell has been used or not ... simply replace the datagrid object with the gridview object. ...
DataGrid Class (System.Web.UI.WebControls) To add an attribute to the
tag, first get the TableCell object that represents the ..... DataBind(); } DataGrid ...<br /><a href="http://www.developerfusion.com/article/4676/building-a-fullfeatured-custom-datagrid-control/8/" title="DataGrid Enhancements - Building a Full-Featured Custom DataGrid ..." target="_" ><b>DataGrid Enhancements - Building a Full-Featured Custom DataGrid ...</b></a> //Add Table Cell to Pager e.Item.Controls.AddAt(0, dgPagerText); //Add custom Previous/Next paging section //Loop indexed by 2 through datagrid paging ...<br /><a href="http://forums.asp.net/t/50297.aspx" title="DataGrid Paging - Page x of N - ASP.NET Forums" target="_" ><b>DataGrid Paging - Page x of N - ASP.NET Forums</b></a> Build a Variety of Custom Controls Based on the DataGrid Control ... Dim Pager as TableCell=CType(e.Item.Controls(0), TableCell) ...<br /><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datagrid(VS.80).aspx" title="DataGrid Class (System.Web.UI.WebControls)" target="_" ><b>DataGrid Class (System.Web.UI.WebControls)</b></a> To add an attribute to the <td> tag, first get the TableCell object that represents ..... DataBind(); } </script> <body> <form runat=server> <h3>DataGrid ...<br /><a href="http://aspalliance.com/stevesmith/articles/dotnethidedatabounditem.asp" title="ASP.NET: Hiding/Manipulating Databound Items" target="_" ><b>ASP.NET: Hiding/Manipulating Databound Items</b></a> In my template for my column in my datagrid, I have an <asp:HyperLink ... In order to do this, I had to make my table cell an HtmlControl by adding ...<br /><a href="http://69.10.233.10/KB/aspnet/add_an_extra_header_to_th.aspx?fid=242982&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1385321" title="CodeProject: Add an extra header to the ASP.NET DataGrid. Free ..." target="_" ><b>CodeProject: Add an extra header to the ASP.NET DataGrid. Free ...</b></a> Click, AddressOf btnRefresh_Click Dim parentsCell As New TableCell parentsCell .... (the one with the tricked-out datagrid) and wire it up for data binding. ...<br /><a href="http://www.codeproject.com/KB/viewstate/DataGridViewState.aspx" title="CodeProject: DataGrid's ViewState optimization. Free source code ..." target="_" ><b>CodeProject: DataGrid's ViewState optimization. Free source code ...</b></a> DataGrid. DataGridTable. DataGridItem. TableCell; TableCell .... Other method is to implement own class to replace LosFormatter and this is the subject for ...<br /><a href="http://www.velocityreviews.com/forums/t360441-loading-gridview-in-code.html" title="Loading Gridview in code" target="_" ><b>Loading Gridview in code</b></a> Since the DataGrid and GridView are all designed to be used with DataBinding, for such scenario, I recommend you to create a custom control ...<br /><a href="http://netcode.ru/dotnet/?lang=&katID=27&skatID=214&artID=5570" title="Customize Pager of DataGrid Control / ASP.NET Controls / ASP. NET ..." target="_" ><b>Customize Pager of DataGrid Control / ASP.NET Controls / ASP. NET ...</b></a> DataSource = arrLst; /Enable Paging , so that we can perform custom styles on it this. ... The first item, Controls[0] , returns a TableCell control. ...<br /></div></td> <td valign="bottom"> <script type="text/javascript"> lqm_channel = 1; lqm_publisher = 303; lqm_zone = 1; lqm_format = 7 ; </script> <script type="text/javascript" src="http://a.lakequincy.com/s.js"></script> </td></tr></table> <br /> <table width="100%"> <tr> <td style="width: 50%"> </td> <td> </td> </tr> </table> <br /> <div style="text-align:center"> <br /> <br /> <b>Search This Site: </b> <input type="hidden" name="cx" value="001993386287184627138:djlrq6ok3yq" /> <input type="hidden" name="cof" value="FORID:10" /> <input type="text" name="q2" id="q2" size="25" onkeypress="if(event.keyCode == 13){SearchSite('q2');return false;}" value="" /> <input type="button" name="sa" value="Search" class="Button" onclick="SearchSite('q2');" /> </div> <br /> <script type="text/javascript"> function doSubscribe(S, E){ DoSubscribe(631083, S,E); } function doFavorite(S, E){ DoFavorite(631083, S,E); } </script> </td> <td id="rightPanel" valign="top" style="width: 100px; text-align: right;"> <div style="text-align: left; font-weight: bold; margin-left: 15px"><br /> <img src="http://www.codeverge.net/images/icons/envelope2.gif" /> <a rel="nofollow" onclick="OpenInviteWin();">Invite</a><br /> <img src="http://www.codeverge.net/images/icons/folders.gif" /> <a href="../History/history_items.aspx" id="ctl00_CPH_RightMenu_A2" rel="nofollow">History</a> <br /> <img src="http://www.codeverge.net/images/icons/books.gif" /> <a href="../resources/computers" id="ctl00_CPH_RightMenu_A1">Resources</a><br /> <img src="http://www.codeverge.net/images/icons/statements.gif" /> <a href="../sitemap/SiteMap.aspx" id="ctl00_CPH_RightMenu_A5" rel="nofollow">SiteMap</a> </div> <br /> <br /> <script type="text/javascript"> lqm_channel = 1; lqm_publisher = 303; lqm_zone = 1; lqm_format = 3; </script> <script type="text/javascript" src="http://a.lakequincy.com/s.js"></script> <br /><br /> <script type="text/javascript"> lqm_channel = 1; lqm_publisher = 303; lqm_zone = 1; lqm_format = 3; </script> <script type="text/javascript" src="http://a.lakequincy.com/s.js"></script> <br /><br /> <script type="text/javascript"> lqm_channel = 1; lqm_publisher = 303; lqm_zone = 1; lqm_format = 3; </script> <script type="text/javascript" src="http://a.lakequincy.com/s.js"></script> <br /><br /> <script type="text/javascript"> lqm_channel = 1; lqm_publisher = 303; lqm_zone = 1; lqm_format = 3; </script> <script type="text/javascript" src="http://a.lakequincy.com/s.js"></script> <div style="width: 100px; overflow: hidden; text-align: left; padding: 5px; font-family: Arial;"> <br /> <a href="http://www.codeverge.net/ng.asp-net-forum.visual_web_developer_2008_express/unable-to-get-file-somefile.txt-from-the-server" title="unable to get file 'somefile.txt' from the server" ><b>unable to get file 'somefile.txt' from the server</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke/article-of-dnn-arch" title="article of dnn arch .." ><b>article of dnn arch ..</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/combine-and-convert-text-to-datetime" title="combine and convert text to datetime" ><b>combine and convert text to datetime</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke/change-default-directory-of-dnn2.1.2" title="change default directory of dnn2.1.2" ><b>change default directory of dnn2.1.2</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.security/symmetric-encryption-of-passwords" title="symmetric encryption of passwords" ><b>symmetric encryption of passwords</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke/how-to-change-email-text-from-the-portal" title="how to?? change email text from the portal.." ><b>how to?? change email text from the portal..</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.security/error-in-web.config-while-reading-machinekey" title="error in web.config while reading machinekey" ><b>error in web.config while reading machinekey</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.visual_studio_2005/.netcharting-with-vb2005" title=".netcharting with vb2005" ><b>.netcharting with vb2005</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/all-of-a-sudden" title="all of a sudden..." ><b>all of a sudden...</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke/have-not-received-my-verification-code-from-dotnetnuke.com" title="have not received my verification code from dotnetnuke.com" ><b>have not received my verification code from dotnetnuke.com</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke/cute-editor-for-dnn-3x" title="cute editor for dnn 3x" ><b>cute editor for dnn 3x</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/why-doesn-t-this-work,5" title="why doesn't this work?" ><b>why doesn't this work?</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.internet_explorer_web_controls/help-a-crayz-problem" title="help! a crayz problem..." ><b>help! a crayz problem...</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.visual_studio_2005/vs-2005-web-deployment-projects-project-lacks-macros" title="vs 2005 "web deployment projects" project lacks macros?" ><b>vs 2005 "web deployment projects" project lacks macros?</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.master_pages_themes_and_navigation_controls/masterpage-hit-counter" title="masterpage hit counter" ><b>masterpage hit counter</b></a><br/><br/><a href="http://www.codeverge.net/microsoft_downloads.css_friendly_control_adapters/positioning-third-and-forth-level-tiers" title="positioning third and forth level tiers" ><b>positioning third and forth level tiers</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/universal-key" title="universal key" ><b>universal key</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/automatically-refresh-part-of-a-web-form" title="automatically refresh part of a web form?" ><b>automatically refresh part of a web form?</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.windows-hosting_open_forum/generating-unique-id-s-for-the-controls" title="generating unique id's for the controls" ><b>generating unique id's for the controls</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/eventlog-problem-in-global.asax.cs" title="eventlog problem in global.asax.cs" ><b>eventlog problem in global.asax.cs</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/how-to-use-global.asax,2" title="how to use global.asax" ><b>how to use global.asax</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/httphandlers-and-httpmodules" title="httphandlers and httpmodules" ><b>httphandlers and httpmodules</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/aspx-page-does-not-show" title="aspx page does not show" ><b>aspx page does not show</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke-resources/create-a-new-portal-in-dnn-3" title="create a new portal in dnn 3" ><b>create a new portal in dnn 3</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.web_parts_and_personalization/webparts-user-maintained-links-folders" title="webparts - user maintained links/folders" ><b>webparts - user maintained links/folders</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.commerce_starter_kit/not-authorized-to-use-this-page" title="not authorized to use this page" ><b>not authorized to use this page</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.visual_studio_2005/where-to-get-and-access-website-administration-tool-in-my-computer" title="where to get and access website administration tool in my computer." ><b>where to get and access website administration tool in my computer.</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.dotnetnuke-getting_started/msde-and-tcp-ip-port" title="msde and tcp ip port" ><b>msde and tcp ip port</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.security/very-slow-intranet-web-site" title="very slow intranet web site" ><b>very slow intranet web site</b></a><br/><br/><a href="http://www.codeverge.net/ng.asp-net-forum.getting_started/pass-value-from-code-behind-to-textbox" title="pass value from code behind to textbox" ><b>pass value from code behind to textbox</b></a><br/><br/> </div> </td> </tr> <tr> <td id="leftBottom" valign="top" style="width: 100px">   </td> <td id="ctl00_centerBottom" valign="top" align="center"> <span id="ctl00_PageFooter1_lbl"></span> <br /> All Times Are GMT </td> <td id="rightBottom" valign="top" style="width: 100px"> </td> </tr> </table> <script type="text/javascript"> //<![CDATA[ var _Rating_MemberRating = -1; var _Rating_tbl = document.getElementById('ctl00_CPH_centerFront_ctl28'); function Rating_RollRates(){ if(_Rating_tbl.rows.length < 10){ for ( i =10 ; i >0; i--){ setTimeout( function(){ var row = _Rating_tbl.insertRow(_Rating_tbl.rows.length); var cell = row.insertCell(0); cell.onclick = function(){Rating_RateIt(this.innerHTML);}; cell.innerHTML = 12 - _Rating_tbl.rows.length; cell.className = 'Rating_AvgRating'; if(cell.innerHTML == _Rating_MemberRating){ cell.title='My Rating'; cell.style.color='orange'; } }, (10-i) * 25); } setTimeout(function(){Rating_Close()},10000) } else{ Rating_Close() } } function Rating_Close(){ if(_Rating_tbl.rows.length > 1) for ( i =0 ; i < 10; i++) setTimeout(function(){ _Rating_tbl.deleteRow(_Rating_tbl.rows.length -1 )} , i * 25) } function Rating_RateIt(rating){ ItemPageWs.RateItem(631083, rating, function(A){ document.getElementById('ctl00_CPH_centerFront_ctl29').innerHTML ='('+ parseFloat(A[0]).toFixed(2) +', '+ A[1] +')'; _Rating_MemberRating = rating; Rating_RollRates(); AlertMsg('Your Rating Was Updated'); Afirm( document.getElementById('ctl00_CPH_centerFront_ctl29')); }); } RestrictHeights('tcContent');Sys.Application.initialize(); //]]> </script> </form> </body> </html> <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_001993386287184627138%3Adjlrq6ok3yq&lang=en"></script> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-3447589-1"); pageTracker._trackPageview(); </script>