Click here to Skip to main content
15,885,757 members

Bugs and Suggestions

   

General discussions, site bug reports and suggestions about the site.

For general questions check out the CodeProject FAQs. To report spam and abuse Head to the Spam and abuse watch. If you wish to report a bug privately, especially those related to security, please email webmaster@codeproject.com

 
GeneralRe: 4 Articles need approval - click - This article was marked as deleted at 26 Nov 2014. Pin
Sean Ewington27-Dec-18 3:30
staffSean Ewington27-Dec-18 3:30 
GeneralRe: 4 Articles need approval - click - This article was marked as deleted at 26 Nov 2014. Pin
User 1106097927-Dec-18 3:35
User 1106097927-Dec-18 3:35 
GeneralRe: 4 Articles need approval - click - This article was marked as deleted at 26 Nov 2014. Pin
User 1106097915-Mar-19 13:28
User 1106097915-Mar-19 13:28 
SuggestionPlease Stop my account Pin
User 1285439625-Dec-18 1:07
User 1285439625-Dec-18 1:07 
GeneralRe: Please Stop my account Pin
OriginalGriff25-Dec-18 19:37
mveOriginalGriff25-Dec-18 19:37 
SuggestionAnd there I thought that the Newsletter had been suspended for Christmas Pin
Mark_Wallace21-Dec-18 19:15
Mark_Wallace21-Dec-18 19:15 
BugCode wrap design looked sucks Pin
wseng19-Dec-18 19:34
wseng19-Dec-18 19:34 
GeneralRe: Code wrap design looked sucks Pin
OriginalGriff19-Dec-18 19:45
mveOriginalGriff19-Dec-18 19:45 
That's because code tags: <code>code</code> are meant for inline highlighting - variable names and such like. If you use it for actual code then it looks very poor:
/// <summary><br />
/// Converts a List to a DataTable by converting each public property to<br />
/// a DataColumn<br />
/// </summary><br />
/// <remarks><br />
/// To stop a column becoming part of the DataTable, set it's Browsable <br />
/// attribute to false:<br />
///         [Browsable(false)]<br />
///         public TrackStatus Status { get; set; }<br />
/// </remarks><br />
/// <typeparam name="T"></typeparam><br />
/// <param name="data"></param><br />
/// <returns></returns><br />
public static DataTable ToDataTable<T>(this IList<T> data)<br />
    {<br />
    PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T));<br />
    bool[] visibility = new bool[properties.Count];<br />
    DataTable dt = new DataTable();<br />
    for (int i = 0; i < properties.Count; i++)<br />
        {<br />
        PropertyDescriptor property = properties[i];<br />
        AttributeCollection ac = property.Attributes;<br />
        visibility[i] = true;<br />
        if (ac.Contains(BrowsableAttribute.No))<br />
            {<br />
            visibility[i] = false;<br />
            continue;<br />
            }<br />
        dt.Columns.Add(property.Name, property.PropertyType);<br />
        }<br />
    foreach (T item in data)<br />
        {<br />
        List<object> values = new List<object>();<br />
        for (int i = 0; i < properties.Count; i++)<br />
            {<br />
            if (visibility[i])<br />
                {<br />
                values.Add(properties[i].GetValue(item));<br />
                }<br />
            }<br />
        dt.Rows.Add(values.ToArray());<br />
        }<br />
    return dt;<br />
    }
If you use pre tags <pre>lump of code</pre> (via the code widget):
C#
/// <summary>
/// Converts a List to a DataTable by converting each public property to
/// a DataColumn
/// </summary>
/// <remarks>
/// To stop a column becoming part of the DataTable, set it's Browsable
/// attribute to false:
///         [Browsable(false)]
///         public TrackStatus Status { get; set; }
/// </remarks>
/// <typeparam name="T"></typeparam>
/// <param name="data"></param>
/// <returns></returns>
public static DataTable ToDataTable<T>(this IList<T> data)
    {
    PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T));
    bool[] visibility = new bool[properties.Count];
    DataTable dt = new DataTable();
    for (int i = 0; i < properties.Count; i++)
        {
        PropertyDescriptor property = properties[i];
        AttributeCollection ac = property.Attributes;
        visibility[i] = true;
        if (ac.Contains(BrowsableAttribute.No))
            {
            visibility[i] = false;
            continue;
            }
        dt.Columns.Add(property.Name, property.PropertyType);
        }
    foreach (T item in data)
        {
        List<object> values = new List<object>();
        for (int i = 0; i < properties.Count; i++)
            {
            if (visibility[i])
                {
                values.Add(properties[i].GetValue(item));
                }
            }
        dt.Rows.Add(values.ToArray());
        }
    return dt;
    }
Then it looks fine.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Code wrap design looked sucks Pin
wseng19-Dec-18 20:16
wseng19-Dec-18 20:16 
GeneralRe: Code wrap design looked sucks Pin
OriginalGriff19-Dec-18 20:21
mveOriginalGriff19-Dec-18 20:21 
GeneralRe: Code wrap design looked sucks Pin
wseng19-Dec-18 20:22
wseng19-Dec-18 20:22 
GeneralRe: Code wrap design looked sucks Pin
OriginalGriff19-Dec-18 23:18
mveOriginalGriff19-Dec-18 23:18 
GeneralRe: Code wrap design looked sucks Pin
wseng20-Dec-18 14:44
wseng20-Dec-18 14:44 
GeneralRe: Code wrap design looked sucks Pin
OriginalGriff20-Dec-18 19:56
mveOriginalGriff20-Dec-18 19:56 
GeneralRe: Code wrap design looked sucks Pin
wseng20-Dec-18 20:49
wseng20-Dec-18 20:49 
GeneralRe: Code wrap design looked sucks Pin
OriginalGriff20-Dec-18 21:13
mveOriginalGriff20-Dec-18 21:13 
GeneralRe: Code wrap design looked sucks Pin
OriginalGriff20-Dec-18 21:13
mveOriginalGriff20-Dec-18 21:13 
GeneralRe: Code wrap design looked sucks Pin
wseng20-Dec-18 21:20
wseng20-Dec-18 21:20 
GeneralRe: Code wrap design looked sucks Pin
Richard MacCutchan20-Dec-18 22:48
mveRichard MacCutchan20-Dec-18 22:48 
GeneralRe: Code wrap design looked sucks Pin
wseng23-Dec-18 14:48
wseng23-Dec-18 14:48 
BugWord wrap is broken on home page Pin
Peter_in_278017-Dec-18 9:43
professionalPeter_in_278017-Dec-18 9:43 
GeneralRe: Word wrap is broken on home page Pin
Chris Maunder17-Dec-18 9:48
cofounderChris Maunder17-Dec-18 9:48 
GeneralRe: Word wrap is broken on home page - updated Pin
Peter_in_278017-Dec-18 10:03
professionalPeter_in_278017-Dec-18 10:03 
BugMajor security issue!!! Pin
rizwan muhammed khan gouri13-Dec-18 9:17
professionalrizwan muhammed khan gouri13-Dec-18 9:17 
AnswerRe: Major security issue!!! Pin
ZurdoDev13-Dec-18 9:17
professionalZurdoDev13-Dec-18 9:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Flags: ClosedUnable to replicateAnsweredFixed

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.