Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Checkbox Coding
Previous Previous
 
Next Next
New Post 9/29/2007 8:05 AM
User is offline GMan
57 posts
10th Ranked


Checkbox Coding 

Using Michael Washingtons "Super Fast - Super Easy Module DAL+" coding to create a module. I have a checkbox control inside an 'InsertItemTemplate' within a formview control. My table contains a NO-Nulls bit field.

controller.vb insert code contains ... GetNull(MyEvent.IsOpenToPublic)
the ASCX file contains ....Checked='<%# Bind("IsOpenToPublic") %>'

When run , the code inserts a TRUE when the checkbox is checked. When not checked the code inserts A NULL.

How do I get a FALSE value sent to the DB?

Thanks

 
New Post 9/29/2007 8:21 AM
User is offline Michael Washington
2842 posts
ADefWebserver.com
5th Ranked










Re: Checkbox Coding 
Modified By Michael Washington  on 9/29/2007 10:25:25 AM)

Using the Object Data Source design takes a little getting used to if you havn't worked with it. Basically you have a number of "events" when you read, insert, update, and delete from data control.

For example in my latest tutorial at:

http://dnnsilverlight.adefwebserver.com/Samples/SilverlightAlbum/tabid/58/Default.aspx

I have this code when I am displaying a picture in the GridView. I am overriding the RowCreated eent on the GridView:

 

protected void gvPictures_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
PicturesInfo objPicturesInfo = (PicturesInfo)e.Row.DataItem;
if (objPicturesInfo != null)
{
Image objImage = (Image)e.Row.FindControl("image1");
string path = MapPath(@"~\DesktopModules\SilverlightAlbum\" + objPicturesInfo.Picture);
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(path);
float scale = 150.0f / System.Math.Max(bmp.Height, bmp.Width);
System.Drawing.Image thumb = bmp.GetThumbnailImage(
(int)(bmp.Width * scale), (int)(bmp.Height * scale),
null, System.IntPtr.Zero);
 
Unit objHeightUnit = new Unit(thumb.Height);
Unit objWidthUnit = new Unit(thumb.Width);
 
objImage.Height = objHeightUnit;
objImage.Width = objWidthUnit;
 
bmp.Dispose();
thumb.Dispose();
}
}
}

 

using simular code you can detect the value in the database and set checkbox properly.

You may also need to override the inserting and updating events to read the checkbox value.


Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Checkbox Coding
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Sunset Hill Solutions - Consulting and Development
We offer general DNN consulting services - including custom module development and commercial module integration/setup.
www.sunsethill.ca
MaximumASP
MaximumASP provides a wide array of web hosting plans to fit any hosting need. We also provide software and services needed to keep it running optimally.
MaximumASP.com
Mad Development: dotnetnuke design and development
We are an expert Dotnetnuke shop specializing in developing solutions that merge the requirements of design and branding, content management, ecommerce, search engine optimization and business logic.
www.MadDevelopment.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP